#include #include #include "xml.h" #include "test/test.h" LILY_FILE_BEGIN(xml_suite) LILY_TEST("get xml attributes") { struct kai_tag_t *t = kai_parse_string( "" ); char *attr1 = kai_tag_get_attr(t, "attr1"); REQUIRE_NEQ(attr1, NULL, "%p"); CHECK_EQS(attr1, "hello"); char *attr2 = kai_tag_get_attr(t, "attr2"); REQUIRE_NEQ(attr2, NULL, "%p"); CHECK_EQS(attr2, "world"); char *attr3 = kai_tag_get_attr(t, "attr3"); CHECK_EQ(attr3, NULL, "%p"); kai_tag_destroy(t); } #include LILY_PUSH_TEST() #define LILY_FILE_END #include LILY_REGISTER_TESTS()