From b7264d6efd3ff4ace549e78fe9e9d4fc896387b7 Mon Sep 17 00:00:00 2001 From: Clint Herron Date: Thu, 4 Apr 2024 09:43:14 -0400 Subject: [PATCH] Fixing whitespace errors and cleaning error message alert to be clearer. --- tests/test-grammar-integration.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test-grammar-integration.cpp b/tests/test-grammar-integration.cpp index b9ed839b3..1a4ada9d4 100644 --- a/tests/test-grammar-integration.cpp +++ b/tests/test-grammar-integration.cpp @@ -30,12 +30,14 @@ expr ::= term ("+" term)* term ::= numero number ::= [0-9]+)"""; + fprintf(stderr, "NOTE: Error message (\"error parsing grammar\") expected on following line during successful test:\n"); + grammar_parser::parse_state parsed_grammar = grammar_parser::parse(grammar_str.c_str()); // Ensure we did NOT parsed correctly assert(parsed_grammar.rules.empty()); - fprintf(stderr, "^ If previous line displays an error, then this test passed.\n"); + fprintf(stderr, "End of expected error message. Test successful.\n"); } static void test_simple_grammar() { @@ -80,7 +82,7 @@ number ::= [0-9]+)"""; assert(completed_grammar); - // Clean up allocated memory + // Clean up allocated memory llama_grammar_free(grammar); } @@ -222,7 +224,7 @@ ws ::= [ \t\n\r]?)"""; grammar->stacks = original_stacks; } - // Clean up allocated memory + // Clean up allocated memory llama_grammar_free(grammar); } @@ -233,4 +235,4 @@ int main() { test_failure_missing_reference(); // Add more test cases as needed return 0; -} \ No newline at end of file +}