summaryrefslogtreecommitdiffhomepage
path: root/tests/custom/04_modules/03_export_list
blob: 8f93f0870daa69740a4679630dca41947d432d02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Already declared local variables and functions may be exported using the
curly brace export list syntax.

-- File test-var-decl.uc --
let testvar = 123;
const testconst = "Test";

function testfunc() {
	print("Hello, world!\n");
}

export { testvar, testconst, testfunc };
-- End --

-- Testcase --
import { testvar, testconst, testfunc } from "./files/test-var-decl.uc";

print([ testvar, testconst, testfunc ], "\n");
-- End --

-- Args --
-R
-- End --

-- Expect stdout --
[ 123, "Test", "function testfunc() { ... }" ]
-- End --