diff --git a/tests/invalid_function_name_intrinsic.qbl b/tests/invalid_function_name_intrinsic.qbl new file mode 100644 index 0000000..69807a4 --- /dev/null +++ b/tests/invalid_function_name_intrinsic.qbl @@ -0,0 +1,8 @@ +//invalid,Function name print at 1:22 is already an intrinsic + +function int => print +{ + deq +} + +42 print \ No newline at end of file diff --git a/tests/invalid_function_name_operation.qbl b/tests/invalid_function_name_operation.qbl new file mode 100644 index 0000000..3fa6d83 --- /dev/null +++ b/tests/invalid_function_name_operation.qbl @@ -0,0 +1,8 @@ +//invalid,Expected function name but got deq at 3:20 + +function int => deq +{ + deq +} + +42 print \ No newline at end of file diff --git a/tests/missing_function_name.qbl b/tests/missing_function_name.qbl new file mode 100644 index 0000000..b832e04 --- /dev/null +++ b/tests/missing_function_name.qbl @@ -0,0 +1,6 @@ +//invalid,Expected function name but got { at 2:2 + +function int => +{ + deq +} \ No newline at end of file diff --git a/test.qbl b/tests/test.qbl similarity index 80% rename from test.qbl rename to tests/test.qbl index e3af7ef..c2db338 100644 --- a/test.qbl +++ b/tests/test.qbl @@ -1,3 +1,6 @@ +//valid +//output: Hello, World!\n4242test2Falsetesttesttest + "Hello, World!\n" print 43 foo foo deq @@ -33,4 +36,4 @@ function int => whileFunction deq } -42 whileFunction \ No newline at end of file +3 whileFunction \ No newline at end of file diff --git a/tests/typecheck_function_multiple_io.qbl b/tests/typecheck_function_multiple_io.qbl new file mode 100644 index 0000000..9ae2695 --- /dev/null +++ b/tests/typecheck_function_multiple_io.qbl @@ -0,0 +1,8 @@ +//valid,output:42footesttest2stuff + +function int str any => str str str foo +{ + print req deq "test" "test2" "stuff" print +} + +42 "foo" "bar" foo print print print \ No newline at end of file diff --git a/tests/unknown_function_basic.qbl b/tests/unknown_function_basic.qbl new file mode 100644 index 0000000..6ea98f6 --- /dev/null +++ b/tests/unknown_function_basic.qbl @@ -0,0 +1,2 @@ +//invalid,Call to unknown function foo at 1:4 +foo \ No newline at end of file diff --git a/tests/unknown_function_hard.qbl b/tests/unknown_function_hard.qbl new file mode 100644 index 0000000..c30c165 --- /dev/null +++ b/tests/unknown_function_hard.qbl @@ -0,0 +1,19 @@ +//invalid,Call to unknown function bar at 7:7 + +function int => foo +{ + while + { + if + { + bar + } + else + { + 1 - + } + } + deq +} + +42 foo \ No newline at end of file diff --git a/tests/unknown_function_in_function.qbl b/tests/unknown_function_in_function.qbl new file mode 100644 index 0000000..cbb7e94 --- /dev/null +++ b/tests/unknown_function_in_function.qbl @@ -0,0 +1,8 @@ +//invalid,Call to unknown function bar at 3:5 + +function => foo +{ + bar +} + +foo \ No newline at end of file