added parserlang though it is throwing error when it should be good in testing, need to fix
This commit is contained in:
parent
9221d1e33e
commit
b702431c88
5 changed files with 152 additions and 94 deletions
|
|
@ -1,8 +1,8 @@
|
|||
#include "../test.h"
|
||||
#include "arc/std/errno.h"
|
||||
#include "arc/std/parser.h"
|
||||
#include "arc/std/parser/parserlang.h"
|
||||
|
||||
//TODO: fix lambda
|
||||
#define LAMBDA ARC_PARSER_TAG_LAMBDA
|
||||
#define CHAR ARC_LEXER_TOKEN_ALPHALOWERCHAR
|
||||
#define NUM ARC_LEXER_TOKEN_NUMBER
|
||||
|
|
@ -150,4 +150,22 @@ ARC_TEST(Parser_Basic_ParseError){
|
|||
ARC_Parser_Parse(parser, &tempString);
|
||||
|
||||
ARC_CHECK(arc_errno == ARC_ERRNO_DATA);
|
||||
|
||||
//reset for next test
|
||||
arc_errno = 0;
|
||||
}
|
||||
|
||||
ARC_TEST(Parser_ParserLang_BasicTest){
|
||||
ARC_Parser *parser;
|
||||
ARC_Parser_CreateAsParserLang(&parser);
|
||||
|
||||
ARC_String *tempString;
|
||||
ARC_String_CreateWithStrlen(&tempString, "<test> -> <testingStuffs>\n");
|
||||
|
||||
//this destroys string, so no need for cleanup
|
||||
ARC_Parser_Parse(parser, &tempString);
|
||||
|
||||
ARC_Parser_Destroy(parser);
|
||||
|
||||
ARC_CHECK(arc_errno == 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue