summaryrefslogtreecommitdiffhomepage
path: root/tests/custom
diff options
context:
space:
mode:
Diffstat (limited to 'tests/custom')
-rw-r--r--tests/custom/99_bugs/50_missing_upvalue_resolving27
-rw-r--r--tests/custom/99_bugs/51_preserve_lexer_flags20
2 files changed, 47 insertions, 0 deletions
diff --git a/tests/custom/99_bugs/50_missing_upvalue_resolving b/tests/custom/99_bugs/50_missing_upvalue_resolving
new file mode 100644
index 0000000..5e96634
--- /dev/null
+++ b/tests/custom/99_bugs/50_missing_upvalue_resolving
@@ -0,0 +1,27 @@
+Commit e5fe6b1 ("treewide: refactor vector usage code") accidentially dropped
+the upvalue resolving logic from uc_vm_stack_push(), leading to unresolved
+upvalues leaking into the script execution context.
+
+-- File test.uc --
+export let obj = { foo: true, bar: false };
+-- End --
+
+-- Testcase --
+import * as test from "./files/test.uc";
+
+printf("%.J\n", [
+ type(test.obj),
+ test.obj.foo
+]);
+-- End --
+
+-- Args --
+-R
+-- End --
+
+-- Expect stdout --
+[
+ "object",
+ true
+]
+-- End --
diff --git a/tests/custom/99_bugs/51_preserve_lexer_flags b/tests/custom/99_bugs/51_preserve_lexer_flags
new file mode 100644
index 0000000..aba646c
--- /dev/null
+++ b/tests/custom/99_bugs/51_preserve_lexer_flags
@@ -0,0 +1,20 @@
+Ensure keyword and regexp flags are preserved across comments when lexing
+object literals and division operators.
+
+-- Testcase --
+{%
+ printf("%.J\n", [
+ { /* comment */ default: true },
+ 4 /* comment */ /2/1
+ ]);
+%}
+-- End --
+
+-- Expect stdout --
+[
+ {
+ "default": true
+ },
+ 2
+]
+-- End --