mirror of
https://github.com/zoriya/xmlParser.git
synced 2026-05-31 09:22:06 +00:00
Parse works with next nodes
This commit is contained in:
@@ -40,6 +40,7 @@ build: $(OBJ)
|
|||||||
$(AR) $(NAME) $(NAME)
|
$(AR) $(NAME) $(NAME)
|
||||||
|
|
||||||
tests_run:
|
tests_run:
|
||||||
|
$(MAKE) -C lib/my
|
||||||
$(CC) -o $(UT) $(SRC) $(TESTS) $(COVERAGE) $(CFLAGS) $(LDFLAGS)
|
$(CC) -o $(UT) $(SRC) $(TESTS) $(COVERAGE) $(CFLAGS) $(LDFLAGS)
|
||||||
$(UT)
|
$(UT)
|
||||||
|
|
||||||
|
|||||||
@@ -31,4 +31,20 @@ Test(xml, withparam)
|
|||||||
cr_assert_str_eq(n->properties->key, "params");
|
cr_assert_str_eq(n->properties->key, "params");
|
||||||
cr_assert_str_eq(n->properties->value, "Test");
|
cr_assert_str_eq(n->properties->value, "Test");
|
||||||
cr_assert_eq(n->properties->next, NULL);
|
cr_assert_eq(n->properties->next, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
Test(xml, withnext)
|
||||||
|
{
|
||||||
|
char *xml = strdup("<yes params=\"Test\"/><nop/>");
|
||||||
|
node *n = xml_parsenode(&xml);
|
||||||
|
|
||||||
|
cr_assert_str_eq(n->name, "yes");
|
||||||
|
cr_assert_eq(n->child, NULL);
|
||||||
|
cr_assert_str_eq(n->properties->key, "params");
|
||||||
|
cr_assert_str_eq(n->properties->value, "Test");
|
||||||
|
cr_assert_eq(n->properties->next, NULL);
|
||||||
|
cr_assert_str_eq(n->next->name, "nop");
|
||||||
|
cr_assert_eq(n->next->child, NULL);
|
||||||
|
cr_assert_eq(n->next->properties, NULL);
|
||||||
|
cr_assert_eq(n->next->next, NULL);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user