From: Bennet Bleßmann Date: Sat, 3 Aug 2024 16:34:34 +0000 (+0200) Subject: add test for declaration errors X-Git-Tag: v0.10.0~123^2~9 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=add03cb4ee62cce3422c2b0ba149a6b06db8113f;p=scryer-prolog.git add test for declaration errors --- diff --git a/tests-pl/invalid_decl1.pl b/tests-pl/invalid_decl1.pl new file mode 100644 index 00000000..ac7a4920 --- /dev/null +++ b/tests-pl/invalid_decl1.pl @@ -0,0 +1 @@ +:- op(10, moin, example). \ No newline at end of file diff --git a/tests-pl/invalid_decl2.pl b/tests-pl/invalid_decl2.pl new file mode 100644 index 00000000..cf3c263c --- /dev/null +++ b/tests-pl/invalid_decl2.pl @@ -0,0 +1 @@ +:- op(4000, xfx, example). \ No newline at end of file diff --git a/tests-pl/invalid_decl3.pl b/tests-pl/invalid_decl3.pl new file mode 100644 index 00000000..42112dbb --- /dev/null +++ b/tests-pl/invalid_decl3.pl @@ -0,0 +1 @@ +:- op(5, xfx, example(a,b)). \ No newline at end of file diff --git a/tests-pl/invalid_decl4.pl b/tests-pl/invalid_decl4.pl new file mode 100644 index 00000000..d1c9764d --- /dev/null +++ b/tests-pl/invalid_decl4.pl @@ -0,0 +1 @@ +:- op(5, xfx, example, too_many_arguments). \ No newline at end of file diff --git a/tests-pl/invalid_decl5.pl b/tests-pl/invalid_decl5.pl new file mode 100644 index 00000000..96646f81 --- /dev/null +++ b/tests-pl/invalid_decl5.pl @@ -0,0 +1 @@ +:- (test -> set_prolog_flag(double_quotes, codes); true). \ No newline at end of file diff --git a/tests-pl/invalid_decl6.pl b/tests-pl/invalid_decl6.pl new file mode 100644 index 00000000..b2935078 --- /dev/null +++ b/tests-pl/invalid_decl6.pl @@ -0,0 +1 @@ +:- 9001. \ No newline at end of file diff --git a/tests-pl/invalid_decl7.pl b/tests-pl/invalid_decl7.pl new file mode 100644 index 00000000..fcee15f3 --- /dev/null +++ b/tests-pl/invalid_decl7.pl @@ -0,0 +1 @@ +:- op(10, 42, example). \ No newline at end of file diff --git a/tests/scryer/cli/src_tests/declaration_errors.md b/tests/scryer/cli/src_tests/declaration_errors.md new file mode 100644 index 00000000..e2b71123 --- /dev/null +++ b/tests/scryer/cli/src_tests/declaration_errors.md @@ -0,0 +1,35 @@ +```trycmd +$ scryer-prolog -f --no-add-history tests-pl/invalid_decl1.pl -g halt + error(syntax_error(inconsistent_entry),load/1). + +``` + +```trycmd +$ scryer-prolog -f --no-add-history tests-pl/invalid_decl2.pl -g halt + error(syntax_error(inconsistent_entry),load/1). + +``` + +```trycmd +$ scryer-prolog -f --no-add-history tests-pl/invalid_decl3.pl -g halt + error(syntax_error(inconsistent_entry),load/1). + +``` + +```trycmd +$ scryer-prolog -f --no-add-history tests-pl/invalid_decl4.pl -g halt + error(syntax_error(inconsistent_entry),load/1). + +``` + +```trycmd +$ scryer-prolog -f --no-add-history tests-pl/invalid_decl5.pl -g halt + error(syntax_error(inconsistent_entry),load/1). + +``` + +```trycmd +$ scryer-prolog -f --no-add-history tests-pl/invalid_decl6.pl -g halt + error(syntax_error(inconsistent_entry),load/1). + +``` \ No newline at end of file diff --git a/tests/scryer/main.rs b/tests/scryer/main.rs index 85f7df98..bb77f334 100644 --- a/tests/scryer/main.rs +++ b/tests/scryer/main.rs @@ -23,5 +23,6 @@ fn cli_tests() { .default_bin_name("scryer-prolog") .case("tests/scryer/cli/issues/*.toml") .skip("tests/scryer/cli/issues/singleton_warning.toml") // wrong line number - .case("tests/scryer/cli/src_tests/*.toml"); + .case("tests/scryer/cli/src_tests/*.toml") + .case("tests/scryer/cli/src_tests/*.md"); }