more tests

This commit is contained in:
anon 2024-09-16 00:06:54 +02:00
parent bf5810c1bc
commit 6756560552
3 changed files with 36 additions and 0 deletions

@ -24,3 +24,23 @@ class CMDTEST_master_batch < Cmdtest::Testcase
end
end
end
class CMDTEST_error_batch < Cmdtest::Testcase
def test_double_top
import_file "test/double_top.tbsp", "./"
cmd "tbsp double_top.tbsp" do
stderr_equal /.*top.*/
exit_nonzero
end
end
def test_no_language
import_file "test/no_language.tbsp", "./"
cmd "tbsp no_language.tbsp" do
stderr_equal /.*language.*/
exit_nonzero
end
end
end

9
test/double_top.tbsp Normal file

@ -0,0 +1,9 @@
%top { /* 1 */ }
%top { /* 2 */ }
%language c
%%
enter translation_unit { ; }
%%
signed main(void) {
return 0;
}

7
test/no_language.tbsp Normal file

@ -0,0 +1,7 @@
%%
enter translation_unit { ; }
%%
signed main(void) {
return 0;
}