aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/bytecode.amal6
-rw-r--r--tests/errors/closure_duplicate_param_name.amal1
-rw-r--r--tests/main.c1
3 files changed, 8 insertions, 0 deletions
diff --git a/tests/bytecode.amal b/tests/bytecode.amal
index 799733b..dd9bd3d 100644
--- a/tests/bytecode.amal
+++ b/tests/bytecode.amal
@@ -7,8 +7,14 @@ const main = fn {
const value3 = 2 + 5 - 1 * 10 / 2;
const str_value = "hello, world";
//printf();
+ print();
+ const result = print_num(value3);
}
const print = fn {
+}
+
+const print_num = fn(num: i32) i32 {
+ return num;
} \ No newline at end of file
diff --git a/tests/errors/closure_duplicate_param_name.amal b/tests/errors/closure_duplicate_param_name.amal
new file mode 100644
index 0000000..4e74eec
--- /dev/null
+++ b/tests/errors/closure_duplicate_param_name.amal
@@ -0,0 +1 @@
+const func = fn(value: i32, value: i32) {} \ No newline at end of file
diff --git a/tests/main.c b/tests/main.c
index 63f72d5..3336c46 100644
--- a/tests/main.c
+++ b/tests/main.c
@@ -251,6 +251,7 @@ static void run_all_tests() {
" extern const a;\n"
" ^\n");
test_load_error("tests/errors/no_main_func.amal", NULL);
+ test_load_error("tests/errors/closure_duplicate_param_name.amal", "TODO: Add expected error here");
}
/* TODO: Restrict variables in global scope to const */