summaryrefslogtreecommitdiffhomepage
path: root/tests/custom/04_modules/01_export_variable_declaration
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-07-30 14:02:03 +0200
committerGitHub <noreply@github.com>2022-07-30 14:02:03 +0200
commite55965a3d170f60776ffa2d82b2711d9ea3a0211 (patch)
treeb73977b8e71445de9e5947d2db3bf941cc174f42 /tests/custom/04_modules/01_export_variable_declaration
parent1219d7efa170bf38fb1bf6a10fa0d1f96e62f091 (diff)
parent156d584e4d0af46c39234ee68a98a16ab4cbe225 (diff)
Merge pull request #96 from jow-/module-import-export-support
Module import export support
Diffstat (limited to 'tests/custom/04_modules/01_export_variable_declaration')
-rw-r--r--tests/custom/04_modules/01_export_variable_declaration29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/custom/04_modules/01_export_variable_declaration b/tests/custom/04_modules/01_export_variable_declaration
new file mode 100644
index 0000000..19a1c11
--- /dev/null
+++ b/tests/custom/04_modules/01_export_variable_declaration
@@ -0,0 +1,29 @@
+Variable declarations can be prepended with `export` to automatically
+export each variable using the same name as the variable itself.
+
+Updates to the variable after the export are reflected properly in
+the including scope.
+
+-- File test-var-decl.uc --
+export let a, b, c;
+export let d = 4, e = 5, f = 6;
+export const g = 7, h = 8, i = 9;
+
+a = 1;
+b = 2;
+c = 3;
+-- End --
+
+-- Testcase --
+import { a, b, c, d, e, f, g, h, i } from "./files/test-var-decl.uc";
+
+print([ a, b, c, d, e, f, g, h, i ], "\n");
+-- End --
+
+-- Args --
+-R
+-- End --
+
+-- Expect stdout --
+[ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
+-- End --