summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-23 19:05:10 +0000
committerZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-23 19:05:10 +0000
commit1991cb62d26b954e54cf13c2d765fb3a0bbaa3ca (patch)
treed183776b150690beb2ee45c1ace4e67ab5a29adc /tests
parenta3ee8766e0fc9cb5c96fd9d38d5b0af7b02e01ff (diff)
Fix for #87
Diffstat (limited to 'tests')
-rw-r--r--tests/basic/test_basics.zc14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/basic/test_basics.zc b/tests/basic/test_basics.zc
index d54389b..57dbb4e 100644
--- a/tests/basic/test_basics.zc
+++ b/tests/basic/test_basics.zc
@@ -8,3 +8,17 @@ test "test_vars" {
var y: int = 20;
println "Sum: {x + y}";
}
+
+fn take_const_arg(x: const int) -> int {
+ return x;
+}
+
+test "test_const_args" {
+ var x = take_const_arg(10);
+ assert(x == 10, "Failed const arg");
+
+ var y: const int = 20;
+ assert(y == 20, "Failed const var");
+
+ println "Const args work!";
+}