20 lines
469 B
C
20 lines
469 B
C
#include "testparser.h"
|
|
#include <assert.h>
|
|
#include <string.h>
|
|
#include "testutils.h"
|
|
|
|
int main()
|
|
{
|
|
char const * input = "ab";
|
|
p_context_t context;
|
|
p_context_init(&context, (uint8_t const *)input, strlen(input));
|
|
assert_eq(P_SUCCESS, p_parse(&context));
|
|
Start * start = p_result(&context);
|
|
assert(start->a != NULL);
|
|
assert(*start->a->pvalue == 1);
|
|
assert(start->b != NULL);
|
|
assert(*start->b->pvalue == 2);
|
|
|
|
p_free_ast(start);
|
|
}
|