From 759d1826c8f17be6503479101868a560d225ed94 Mon Sep 17 00:00:00 2001 From: laurens Date: Tue, 12 Nov 2019 20:28:08 +0100 Subject: [PATCH] Add test with no braces in source - Should return 0 since no braces in source --- test/unit/cmock_header_parser_test.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/unit/cmock_header_parser_test.rb b/test/unit/cmock_header_parser_test.rb index a58b087..07b77ee 100644 --- a/test/unit/cmock_header_parser_test.rb +++ b/test/unit/cmock_header_parser_test.rb @@ -1988,9 +1988,13 @@ describe CMockHeaderParser, "Verify CMockHeaderParser Module" do "\t}\n" + "\treturn 42;\n" + "}\n" + bad_source_2 = + "int foo(struct my_struct *s)\n" + + "\n" # No braces in source assert_equal(0, @parser.count_number_of_pairs_of_braces_in_function(bad_source_0)) assert_equal(0, @parser.count_number_of_pairs_of_braces_in_function(bad_source_1)) + assert_equal(0, @parser.count_number_of_pairs_of_braces_in_function(bad_source_2)) end end