[impl] more passing over the parser; found an odd part and made a test to reveal a bug

This commit is contained in:
Allen Webster
2021-06-06 01:06:36 -07:00
parent dd445676f5
commit bf2d161158
5 changed files with 102 additions and 87 deletions
+24
View File
@@ -724,5 +724,29 @@ int main(void)
}
}
Test("Tagged & Unlabeled")
{
// TODO(allen): these tests checking for rules that I find fishy; maybe instead
// of trying to pass these tests, adjust the rules so we don't have this odd
// expected behavior to begin with? Not sure.
MD_String8 file_name = MD_S8Lit("raw_text");
{
MD_ParseResult result = MD_ParseWholeString(file_name, MD_S8Lit("foo:{@tag {bar}}\n"));
TestResult(result.first_error == 0);
}
{
MD_ParseResult result = MD_ParseWholeString(file_name, MD_S8Lit("foo:@tag bar\n"));
TestResult(result.first_error == 0);
}
{
MD_ParseResult result = MD_ParseWholeString(file_name, MD_S8Lit("foo:bar @tag {bar}\n"));
TestResult(result.first_error == 0);
}
{
MD_ParseResult result = MD_ParseWholeString(file_name, MD_S8Lit("foo:@tag {bar}\n"));
TestResult(result.first_error != 0);
}
}
return 0;
}