summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/const-array.mnml6
-rw-r--r--test/const-function-if.mnml3
-rw-r--r--test/const-map.mnml7
-rw-r--r--test/const-simple.mnml2
4 files changed, 17 insertions, 1 deletions
diff --git a/test/const-array.mnml b/test/const-array.mnml
index 03c7163..e5f30b8 100644
--- a/test/const-array.mnml
+++ b/test/const-array.mnml
@@ -1,2 +1,8 @@
const array: [integer] = [1, 2, 3]
const array2: [integer] = [3, 4, 5]
+
+const main: function = (array3: [integer], array4: [integer]): integer {
+ return array4[1]
+}
+
+main(array3 = array, array4 = array2)
diff --git a/test/const-function-if.mnml b/test/const-function-if.mnml
index 11883cd..2b62f8e 100644
--- a/test/const-function-if.mnml
+++ b/test/const-function-if.mnml
@@ -1,6 +1,7 @@
const main: function = (input: string): string {
if (input == "hello") {
const bye: string = "bye"
+ return input + bye
}
return input
@@ -11,3 +12,5 @@ const main2: function = (input: string): string {
return main(input = "hello")
}
+
+main(input = "hello")
diff --git a/test/const-map.mnml b/test/const-map.mnml
index b63b68b..6942bba 100644
--- a/test/const-map.mnml
+++ b/test/const-map.mnml
@@ -8,4 +8,11 @@ const map: [string][string or integer or bool] = [
},*/
"sixth" = 20_000,
"seventh" = 20.02,
+ "eight" = [8, 9, 0],
]
+
+const main: function = (input: [string][string or integer or bool]): string {
+ return input["eight"][2]
+}
+
+main(input = map)
diff --git a/test/const-simple.mnml b/test/const-simple.mnml
index 5da0a0f..f7f597d 100644
--- a/test/const-simple.mnml
+++ b/test/const-simple.mnml
@@ -1,2 +1,2 @@
const henshin: integer = 2
-const new: integer = henshin + 5 * 10
+const new: integer = (henshin * 5) + 10