]> Repositorios git - scryer-prolog.git/commitdiff
add test for declaration errors
authorBennet Bleßmann <[email protected]>
Sat, 3 Aug 2024 16:34:34 +0000 (18:34 +0200)
committerBennet Bleßmann <[email protected]>
Mon, 5 Aug 2024 19:25:42 +0000 (21:25 +0200)
tests-pl/invalid_decl1.pl [new file with mode: 0644]
tests-pl/invalid_decl2.pl [new file with mode: 0644]
tests-pl/invalid_decl3.pl [new file with mode: 0644]
tests-pl/invalid_decl4.pl [new file with mode: 0644]
tests-pl/invalid_decl5.pl [new file with mode: 0644]
tests-pl/invalid_decl6.pl [new file with mode: 0644]
tests-pl/invalid_decl7.pl [new file with mode: 0644]
tests/scryer/cli/src_tests/declaration_errors.md [new file with mode: 0644]
tests/scryer/main.rs

diff --git a/tests-pl/invalid_decl1.pl b/tests-pl/invalid_decl1.pl
new file mode 100644 (file)
index 0000000..ac7a492
--- /dev/null
@@ -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 (file)
index 0000000..cf3c263
--- /dev/null
@@ -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 (file)
index 0000000..42112db
--- /dev/null
@@ -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 (file)
index 0000000..d1c9764
--- /dev/null
@@ -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 (file)
index 0000000..96646f8
--- /dev/null
@@ -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 (file)
index 0000000..b293507
--- /dev/null
@@ -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 (file)
index 0000000..fcee15f
--- /dev/null
@@ -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 (file)
index 0000000..e2b7112
--- /dev/null
@@ -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
index 85f7df98f83e3cf7b392399d800e389bc14cba96..bb77f334b2f223e0bf7bf0c440253225bcafe7f6 100644 (file)
@@ -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");
 }