mirror of
https://github.com/zoriya/xmlParser.git
synced 2025-12-06 02:56:10 +00:00
The xml parse works for <yes/>. Adding tests
This commit is contained in:
21
tests/test_basics.c
Normal file
21
tests/test_basics.c
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
** EPITECH PROJECT, 2019
|
||||
** xmlparser
|
||||
** File description:
|
||||
** test_basics
|
||||
*/
|
||||
|
||||
#include "xml.h"
|
||||
#include <criterion/criterion.h>
|
||||
#include <string.h>
|
||||
|
||||
Test(xml, simple)
|
||||
{
|
||||
char *xml = strdup("<yes/>");
|
||||
node *n = xml_parsenode(&xml);
|
||||
|
||||
cr_assert_str_eq(n->name, "yes");
|
||||
cr_assert_eq(n->child, NULL);
|
||||
cr_assert_eq(n->next, NULL);
|
||||
cr_assert_eq(n->properties, NULL);
|
||||
}
|
||||
18
tests/test_main.c
Normal file
18
tests/test_main.c
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
** EPITECH PROJECT, 2019
|
||||
** xmlparser
|
||||
** File description:
|
||||
** test_main
|
||||
*/
|
||||
|
||||
#include "xml.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
if (argc != 2)
|
||||
return (printf("Usage: %s xml_path\n", argv[0]), 0);
|
||||
node *n = xmlparse(argv[1]);
|
||||
(void)n;
|
||||
return (0);
|
||||
}
|
||||
1
tests/xmltest.txt
Normal file
1
tests/xmltest.txt
Normal file
@@ -0,0 +1 @@
|
||||
<yes/>
|
||||
Reference in New Issue
Block a user