X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Ftstxmlquery.c;h=fb0fddba3fe282187a1815aa637d2f1d6d196c17;hb=7e156f9a105b894b600c78d0b0a55224ae9b9793;hp=625d5e2d2d643d432aa4fa747e0bffd7eacb2040;hpb=3086f0e19e38428814c7da92fcaf21eba2bc9a64;p=yaz-moved-to-github.git diff --git a/test/tstxmlquery.c b/test/tstxmlquery.c index 625d5e2..fb0fddb 100644 --- a/test/tstxmlquery.c +++ b/test/tstxmlquery.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: tstxmlquery.c,v 1.6 2006-01-30 14:02:07 adam Exp $ + * $Id: tstxmlquery.c,v 1.8 2006-02-02 15:00:58 adam Exp $ */ #include @@ -45,9 +45,9 @@ enum pqf2xml_status pqf2xml_text(const char *pqf, const char *expect_xml) status = PQF_FAILED; else { - status = QUERY2XML_FAILED; #if HAVE_XML2 xmlDocPtr doc = 0; + yaz_rpnquery2xml(rpn, &doc); if (!doc) @@ -71,6 +71,8 @@ enum pqf2xml_status pqf2xml_text(const char *pqf, const char *expect_xml) } xmlFreeDoc(doc); } +#else + status = QUERY2XML_FAILED; #endif } odr_destroy(odr); @@ -86,7 +88,7 @@ void tst() "\n" "" "" - "computer" + "computer" "\n"), XML_MATCH); YAZ_CHECK_EQ(pqf2xml_text( @@ -95,7 +97,7 @@ void tst() "" "" "" - "computer" + "computer" "\n"), XML_MATCH); YAZ_CHECK_EQ(pqf2xml_text( @@ -104,7 +106,7 @@ void tst() "" "" "" - "computer" + "computer" "\n"), XML_MATCH); YAZ_CHECK_EQ(pqf2xml_text( @@ -112,7 +114,8 @@ void tst() "\n" "" "" - "ab" + "a" + "b" "\n"), XML_MATCH); YAZ_CHECK_EQ(pqf2xml_text( @@ -120,9 +123,10 @@ void tst() "\n" "" "" - "a" - "b" - "c" + "" + "a" + "b" + "c" "\n"), XML_MATCH); YAZ_CHECK_EQ(pqf2xml_text( @@ -142,9 +146,34 @@ void tst() "ordered=\"true\" " "relationType=\"2\" " "knownProximityUnit=\"2\">" - "ab" + "a" + "b" "\n"), XML_MATCH); + YAZ_CHECK_EQ(pqf2xml_text( + "@term numeric 32", + "\n" + "" + "" + "32" + "\n"), XML_MATCH); + + YAZ_CHECK_EQ(pqf2xml_text( + "@term string computer", + "\n" + "" + "" + "computer" + "\n"), XML_MATCH); + + YAZ_CHECK_EQ(pqf2xml_text( + "@term null void", + "\n" + "" + "" + "" + "\n"), XML_MATCH); + #endif }