aboutsummaryrefslogtreecommitdiff
path: root/tests/icon/regression
diff options
context:
space:
mode:
authorGravatar Moon Flower <moonflower@elhenney.local> 2026-10-14 08:29:46 +0330
committerGravatar Moon Flower <moonflower@elhenney.local> 2026-10-14 08:29:46 +0330
commit1c53304d03414890af0da7432d1aea87e754a14a (patch)
tree97190d86cf548c9bc63f68c86a4d2a4f09809713 /tests/icon/regression
parenta (diff)
feat: grow memory limits, add icon/actor libraries, overhaul LSP diagnostics
Compiler and VM - make every memory map limit dynamic and adjustable at both build time and runtime, including compiler tables, stacks, and every execution region - reserve and grow tables, operand and return stacks, frame segments, and image-building output without relocating live code or globals - rename i/o and string helpers consistently (puts -> put_s, putn -> put_n, scat -> cat_s) across compiler, runtime, examples, tests, and docs - recast and consume values assigned to globals from inside functions - allow fixed and const together, add typed closure returns (fn:t(...)), multi-include syntax (include rt, run, core;), and recurse type inference - never infer string literals as word, anywhere, as argument, variable, or return type - draft docs/BORROW.md: a borrow checker less intrusive than Rust's but more intelligent LSP and editor integration - require explicit includes and give every toolchain area its own namespace (rt, lsp, run, core) - hover for built-in types, inferred types, values known at hover time, array and pointer lifetime/size, library names in include statements, and inferred lifetimes with explanations - honor /* */ comments as documentation for variables and arguments, and stop misattributing section headers or trailing comments as variable hints - stream diagnostics and cancel stale requests on change - jump to definition and references, including cross-file - quick fixes with automatic library import, and namespace completion Hints and diagnostics - render hints as blue squigglies by default, with hints on/small/off per file - suppress magic-number hints via a preceding /* */ comment, and say so - warn on unused arguments; allow multiple _ discards in parameters, pattern matching, and tagged enums, warning if a _ is actually used - rewrite hint and comment prose in professional compiler-doc register Libraries - add icon.zc: run-time self-modification, find/replace syntax, type and block edits, and step-through inspection of locals and globals - add actor.zc: async actors with Actor<I,O>, implicit this, spawn/recv/send, injected into the compiler machinery at include time rather than built in Tooling and docs - reorganize sources, tests, and designs into subdirectories - unify windows entry points in tinyvm.bat and add a matching tinyvm.sh - add --help across the toolchain - polish the learning guide, stdlib docs, and design notes Tests - add accept, reject, and regression coverage across the compiler, LSP, - runtime, icon, actors, threads, formatting, and the toolchain contracts, plus fuzzers and property tests
Diffstat (limited to 'tests/icon/regression')
-rw-r--r--tests/icon/regression/block_capture_boundary.expected1
-rw-r--r--tests/icon/regression/block_capture_boundary.zc10
-rw-r--r--tests/icon/regression/frame_cleanup.expected1
-rw-r--r--tests/icon/regression/frame_cleanup.zc16
-rw-r--r--tests/icon/regression/inspect_modify_resume.expected1
-rw-r--r--tests/icon/regression/inspect_modify_resume.zc12
-rw-r--r--tests/icon/regression/literal_capture.expected1
-rw-r--r--tests/icon/regression/literal_capture.zc11
-rw-r--r--tests/icon/regression/mismatch_capture.expected1
-rw-r--r--tests/icon/regression/mismatch_capture.zc10
-rw-r--r--tests/icon/regression/no_match.expected2
-rw-r--r--tests/icon/regression/no_match.zc11
-rw-r--r--tests/icon/regression/preserve_const.expected1
-rw-r--r--tests/icon/regression/preserve_const.zc9
-rw-r--r--tests/icon/regression/repeated_publication.expected1
-rw-r--r--tests/icon/regression/repeated_publication.zc10
-rw-r--r--tests/icon/regression/replace_all.expected1
-rw-r--r--tests/icon/regression/replace_all.zc10
-rw-r--r--tests/icon/regression/shadow.expected1
-rw-r--r--tests/icon/regression/shadow.zc10
-rw-r--r--tests/icon/regression/statement_capture_boundary.expected1
-rw-r--r--tests/icon/regression/statement_capture_boundary.zc10
-rw-r--r--tests/icon/regression/status_clear.expected1
-rw-r--r--tests/icon/regression/status_clear.zc14
-rw-r--r--tests/icon/regression/strings.expected2
-rw-r--r--tests/icon/regression/strings.zc12
26 files changed, 160 insertions, 0 deletions
diff --git a/tests/icon/regression/block_capture_boundary.expected b/tests/icon/regression/block_capture_boundary.expected
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/tests/icon/regression/block_capture_boundary.expected
@@ -0,0 +1 @@
+7
diff --git a/tests/icon/regression/block_capture_boundary.zc b/tests/icon/regression/block_capture_boundary.zc
new file mode 100644
index 0000000..29925c4
--- /dev/null
+++ b/tests/icon/regression/block_capture_boundary.zc
@@ -0,0 +1,10 @@
+include rt;
+include run;
+include icon;
+fn main() {
+ let q = run.tokens("{ return 1; } { return 2; } ;");
+ let p = run.tokens("$block:x ;"), replacement = run.tokens("{}");
+ let r = icon.rewrite(q, p, replacement);
+ rt.put_n(r[0]); rt.put_c(10);
+ return 0;
+}
diff --git a/tests/icon/regression/frame_cleanup.expected b/tests/icon/regression/frame_cleanup.expected
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/tests/icon/regression/frame_cleanup.expected
@@ -0,0 +1 @@
+1
diff --git a/tests/icon/regression/frame_cleanup.zc b/tests/icon/regression/frame_cleanup.zc
new file mode 100644
index 0000000..b55c27e
--- /dev/null
+++ b/tests/icon/regression/frame_cleanup.zc
@@ -0,0 +1,16 @@
+include rt;
+include run;
+include icon;
+fn main() {
+ let q = run.tokens("");
+ int before = rt.live_objects(), i = 0;
+ while (i < 100) {
+ let frame = icon.begin(q);
+ icon.set_local(frame, "local", i);
+ icon.set_global(frame, "global", i + 1);
+ icon.close(d*frame);
+ i++;
+ }
+ rt.put_n(rt.live_objects() == before); rt.put_c(10);
+ return 0;
+}
diff --git a/tests/icon/regression/inspect_modify_resume.expected b/tests/icon/regression/inspect_modify_resume.expected
new file mode 100644
index 0000000..90619d0
--- /dev/null
+++ b/tests/icon/regression/inspect_modify_resume.expected
@@ -0,0 +1 @@
+8 3
diff --git a/tests/icon/regression/inspect_modify_resume.zc b/tests/icon/regression/inspect_modify_resume.zc
new file mode 100644
index 0000000..b9bfad1
--- /dev/null
+++ b/tests/icon/regression/inspect_modify_resume.zc
@@ -0,0 +1,12 @@
+include rt;
+include run;
+include icon;
+fn main() {
+ let q = run.tokens("int n = 1; while (n < 3) { n++; } return n;");
+ let frame = icon.begin(q);
+ icon.step(frame); icon.set_local(frame, "n", 8);
+ icon.resume(frame, 5);
+ rt.put_n(icon.result(frame)); rt.put_c(' '); rt.put_n(icon.steps(frame)); rt.put_c(10);
+ icon.close(d*frame);
+ return 0;
+}
diff --git a/tests/icon/regression/literal_capture.expected b/tests/icon/regression/literal_capture.expected
new file mode 100644
index 0000000..d81cc07
--- /dev/null
+++ b/tests/icon/regression/literal_capture.expected
@@ -0,0 +1 @@
+42
diff --git a/tests/icon/regression/literal_capture.zc b/tests/icon/regression/literal_capture.zc
new file mode 100644
index 0000000..baf0385
--- /dev/null
+++ b/tests/icon/regression/literal_capture.zc
@@ -0,0 +1,11 @@
+include rt;
+include run;
+include icon;
+fn main() {
+ let q = run.tokens("return \"return\";");
+ let p = run.tokens("return $expr:x;");
+ let replacement = run.tokens("return 42;");
+ let r = icon.rewrite(q, p, replacement);
+ rt.put_n(run.eval(r)); rt.put_c(10);
+ return 0;
+}
diff --git a/tests/icon/regression/mismatch_capture.expected b/tests/icon/regression/mismatch_capture.expected
new file mode 100644
index 0000000..f6b91e0
--- /dev/null
+++ b/tests/icon/regression/mismatch_capture.expected
@@ -0,0 +1 @@
+56
diff --git a/tests/icon/regression/mismatch_capture.zc b/tests/icon/regression/mismatch_capture.zc
new file mode 100644
index 0000000..53fb3c6
--- /dev/null
+++ b/tests/icon/regression/mismatch_capture.zc
@@ -0,0 +1,10 @@
+include rt;
+include run;
+include icon;
+fn main() {
+ let q = run.tokens("return (2 + 5) * (2 + 6);");
+ let pattern = run.tokens("$expr:x * $expr:x"), replacement = run.tokens("$x + 1");
+ let edited = icon.rewrite(q, pattern, replacement);
+ rt.put_n(run.eval(edited)); rt.put_c(10);
+ return 0;
+}
diff --git a/tests/icon/regression/no_match.expected b/tests/icon/regression/no_match.expected
new file mode 100644
index 0000000..cfe9b7e
--- /dev/null
+++ b/tests/icon/regression/no_match.expected
@@ -0,0 +1,2 @@
+12
+1
diff --git a/tests/icon/regression/no_match.zc b/tests/icon/regression/no_match.zc
new file mode 100644
index 0000000..5686c4a
--- /dev/null
+++ b/tests/icon/regression/no_match.zc
@@ -0,0 +1,11 @@
+include rt;
+include run;
+include icon;
+fn main() {
+ let q = run.tokens("return 12;");
+ let pattern = run.tokens("1 + 2"), replacement = run.tokens("5");
+ let r = icon.rewrite(q, pattern, replacement);
+ rt.put_n(run.eval(r)); rt.put_c(10);
+ rt.put_n(q[0] == r[0]); rt.put_c(10);
+ return 0;
+}
diff --git a/tests/icon/regression/preserve_const.expected b/tests/icon/regression/preserve_const.expected
new file mode 100644
index 0000000..2fb73a0
--- /dev/null
+++ b/tests/icon/regression/preserve_const.expected
@@ -0,0 +1 @@
+1 1
diff --git a/tests/icon/regression/preserve_const.zc b/tests/icon/regression/preserve_const.zc
new file mode 100644
index 0000000..4824413
--- /dev/null
+++ b/tests/icon/regression/preserve_const.zc
@@ -0,0 +1,9 @@
+include rt;
+include run;
+include icon;
+fn main() {
+ let q = run.tokens("const int total = 3;"), type = run.tokens("i32");
+ let edited = icon.change_type(q, "total", type);
+ rt.put_n(edited[2] == run.intern("const")); rt.put_c(' '); rt.put_n(edited[5] == run.intern("i32")); rt.put_c(10);
+ return 0;
+}
diff --git a/tests/icon/regression/repeated_publication.expected b/tests/icon/regression/repeated_publication.expected
new file mode 100644
index 0000000..f847703
--- /dev/null
+++ b/tests/icon/regression/repeated_publication.expected
@@ -0,0 +1 @@
+1 8 1 9
diff --git a/tests/icon/regression/repeated_publication.zc b/tests/icon/regression/repeated_publication.zc
new file mode 100644
index 0000000..b8f4268
--- /dev/null
+++ b/tests/icon/regression/repeated_publication.zc
@@ -0,0 +1,10 @@
+include rt;
+include run;
+include icon;
+int target() { return 7; }
+fn main() {
+ let first = run.tokens("7"), second = run.tokens("8"), third = run.tokens("9");
+ rt.put_n(icon.find_replace(target, first, second)); rt.put_c(' '); rt.put_n(target()); rt.put_c(' ');
+ rt.put_n(icon.find_replace(target, second, third)); rt.put_c(' '); rt.put_n(target()); rt.put_c(10);
+ return 0;
+}
diff --git a/tests/icon/regression/replace_all.expected b/tests/icon/regression/replace_all.expected
new file mode 100644
index 0000000..d0f5ee9
--- /dev/null
+++ b/tests/icon/regression/replace_all.expected
@@ -0,0 +1 @@
+-2 24
diff --git a/tests/icon/regression/replace_all.zc b/tests/icon/regression/replace_all.zc
new file mode 100644
index 0000000..acb4458
--- /dev/null
+++ b/tests/icon/regression/replace_all.zc
@@ -0,0 +1,10 @@
+include rt;
+include run;
+include icon;
+fn main() {
+ let q = run.tokens("return (1 + 2) * (5 + 3);");
+ let pattern = run.tokens("$int + $int"), replacement = run.tokens("$int - $int");
+ let edited = icon.rewrite(q, pattern, replacement);
+ rt.put_n(run.eval(edited)); rt.put_c(' '); rt.put_n(run.eval(q)); rt.put_c(10);
+ return 0;
+}
diff --git a/tests/icon/regression/shadow.expected b/tests/icon/regression/shadow.expected
new file mode 100644
index 0000000..606c19a
--- /dev/null
+++ b/tests/icon/regression/shadow.expected
@@ -0,0 +1 @@
+3 1
diff --git a/tests/icon/regression/shadow.zc b/tests/icon/regression/shadow.zc
new file mode 100644
index 0000000..ca4220d
--- /dev/null
+++ b/tests/icon/regression/shadow.zc
@@ -0,0 +1,10 @@
+include rt;
+include run;
+include icon;
+fn main() {
+ let q = run.tokens("int n = 3; { int n = 8; n++; } return n;");
+ let frame = icon.begin(q);
+ icon.resume(frame, 10); rt.put_n(icon.result(frame)); rt.put_c(' '); rt.put_n(icon.local_count(frame)); rt.put_c(10);
+ icon.close(d*frame);
+ return 0;
+}
diff --git a/tests/icon/regression/statement_capture_boundary.expected b/tests/icon/regression/statement_capture_boundary.expected
new file mode 100644
index 0000000..1e8b314
--- /dev/null
+++ b/tests/icon/regression/statement_capture_boundary.expected
@@ -0,0 +1 @@
+6
diff --git a/tests/icon/regression/statement_capture_boundary.zc b/tests/icon/regression/statement_capture_boundary.zc
new file mode 100644
index 0000000..8316eb9
--- /dev/null
+++ b/tests/icon/regression/statement_capture_boundary.zc
@@ -0,0 +1,10 @@
+include rt;
+include run;
+include icon;
+fn main() {
+ let q = run.tokens("return 1; return 2; tail;");
+ let p = run.tokens("$stmt:x tail;"), replacement = run.tokens("return 9;");
+ let r = icon.rewrite(q, p, replacement);
+ rt.put_n(r[0]); rt.put_c(10);
+ return 0;
+}
diff --git a/tests/icon/regression/status_clear.expected b/tests/icon/regression/status_clear.expected
new file mode 100644
index 0000000..87bde8e
--- /dev/null
+++ b/tests/icon/regression/status_clear.expected
@@ -0,0 +1 @@
+0 3 0
diff --git a/tests/icon/regression/status_clear.zc b/tests/icon/regression/status_clear.zc
new file mode 100644
index 0000000..89e8535
--- /dev/null
+++ b/tests/icon/regression/status_clear.zc
@@ -0,0 +1,14 @@
+include rt;
+include run;
+include icon;
+fn main() {
+ let q = run.tokens("");
+ let f = icon.begin(q);
+ icon.local(f, "missing");
+ icon.set_local(f, "n", 3);
+ rt.put_n(icon.error()); rt.put_c(' ');
+ icon.local(f, "missing");
+ rt.put_n(icon.local(f, "n")); rt.put_c(' '); rt.put_n(icon.error()); rt.put_c(10);
+ icon.close(d*f);
+ return 0;
+}
diff --git a/tests/icon/regression/strings.expected b/tests/icon/regression/strings.expected
new file mode 100644
index 0000000..c1eac1e
--- /dev/null
+++ b/tests/icon/regression/strings.expected
@@ -0,0 +1,2 @@
+5 5 11
+1
diff --git a/tests/icon/regression/strings.zc b/tests/icon/regression/strings.zc
new file mode 100644
index 0000000..051a29d
--- /dev/null
+++ b/tests/icon/regression/strings.zc
@@ -0,0 +1,12 @@
+include rt;
+include run;
+include icon;
+fn main() {
+ let q = run.tokens("return 8 + 3;"), p = run.tokens("$int + $int"), r = run.tokens("$int - $int");
+ let a = icon.rewrite(q, p, r), b = icon.rewrite(q, p, r);
+ rt.put_n(run.eval(a)); rt.put_c(' '); rt.put_n(run.eval(b)); rt.put_c(' '); rt.put_n(run.eval(q)); rt.put_c(10);
+ let text = run.tokens("return \"{} 8 + 3\";");
+ let same = icon.rewrite(text, p, r);
+ rt.put_n(text[0] == same[0]); rt.put_c(10);
+ return 0;
+}