aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-14 16:50:41 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-14 16:50:41 +0330
commitccbc77c2d3fa348d0de6f32fc540468401e6880b (patch)
tree32137a48a9a66e5ca486fee5597aaed3f0c12a8b /tests
parentbool: a value stored into a bool is normalised to 0 or 1 (appendix b.2.6) (diff)
lexer: a block comment that is never closed is 'unterminated comment' (appendix b.2.11)
Diffstat (limited to 'tests')
-rw-r--r--tests/conformance/1-source/comment_block_unclosed.zc3
-rw-r--r--tests/conformance/9-appendix-b/b2_11_unterminated_comment.zc2
-rw-r--r--tests/conformance/known.txt1
-rw-r--r--tests/langerrors/unterminated_comment_docs.zc4
4 files changed, 7 insertions, 3 deletions
diff --git a/tests/conformance/1-source/comment_block_unclosed.zc b/tests/conformance/1-source/comment_block_unclosed.zc
index 4ae34e7..cb410f9 100644
--- a/tests/conformance/1-source/comment_block_unclosed.zc
+++ b/tests/conformance/1-source/comment_block_unclosed.zc
@@ -1,4 +1,5 @@
-// expect: 4/
+// expect error: unterminated comment
+// spec 1.2.2: a block comment that is never closed is an error
include rt;
fn main() { rt.put_n(4); rt.put_c(10); return 0; }
/* never closed: rt.put_n(9);
diff --git a/tests/conformance/9-appendix-b/b2_11_unterminated_comment.zc b/tests/conformance/9-appendix-b/b2_11_unterminated_comment.zc
index e6e6bbf..ce4b236 100644
--- a/tests/conformance/9-appendix-b/b2_11_unterminated_comment.zc
+++ b/tests/conformance/9-appendix-b/b2_11_unterminated_comment.zc
@@ -1,4 +1,4 @@
-// expect error: unterminated
+// expect error: unterminated comment
// spec appendix b.2.11: an unterminated /* is accepted silently
include rt;
void pn(int x) { rt.put_n(x); rt.put_c(10); }
diff --git a/tests/conformance/known.txt b/tests/conformance/known.txt
index 8550c07..f666106 100644
--- a/tests/conformance/known.txt
+++ b/tests/conformance/known.txt
@@ -4,7 +4,6 @@
4-statements/o3_outside_function_ordinary_block.zc zy c top-level o3 { } is rejected; spec 4.10.2 says it is an ordinary block
5-declarations/fn_prototype_unnamed_params_b13.zc zy c spec 5.2.1 says prototype parameter names are required, and a type name alone is read as an untyped parameter of that name (paramstart); b.2.13 is a spec choice, not fixed
9-appendix-b/b2_10_recovery_hides_errors.zc zy c appendix b.2.10 confirmed; by design per 8.2
-9-appendix-b/b2_11_unterminated_comment.zc zy c appendix b.2.11 confirmed, but spec 1.2.2 says an unclosed block comment is not an error
9-appendix-b/b2_12_as_int_star.zc zy c appendix b.2.12 confirmed, but spec 3.2.3 documents it (parenthesise)
9-appendix-b/b2_14_len_char_ptr_typecheck_off.zc zy c appendix b.2.14 confirmed, but spec 3.13.5 leaves it unspecified
9-appendix-b/b2_15_duplicate_case.zc zy c appendix b.2.15 confirmed; 4.7.2 says duplicates are allowed
diff --git a/tests/langerrors/unterminated_comment_docs.zc b/tests/langerrors/unterminated_comment_docs.zc
new file mode 100644
index 0000000..02f4335
--- /dev/null
+++ b/tests/langerrors/unterminated_comment_docs.zc
@@ -0,0 +1,4 @@
+// expect: unterminated comment
+docs on;
+fn main() { return 0; }
+/* never closed, with docs on