diff --git a/src/arkreactor/Builtins/Mathematics.cpp b/src/arkreactor/Builtins/Mathematics.cpp index 19b900a8..aad304d4 100644 --- a/src/arkreactor/Builtins/Mathematics.cpp +++ b/src/arkreactor/Builtins/Mathematics.cpp @@ -126,12 +126,6 @@ namespace Ark::internal::Builtins::Mathematics */ Value isnan_(std::vector& n, VM* vm [[maybe_unused]]) { - if (!types::check(n, ValueType::Any)) - throw types::TypeCheckingError( - "math:NaN?", - { { types::Contract { { types::Typedef("value", ValueType::Any) } } } }, - n); - if (n[0].valueType() != ValueType::Number) return falseSym; @@ -150,12 +144,6 @@ namespace Ark::internal::Builtins::Mathematics */ Value isinf_(std::vector& n, VM* vm [[maybe_unused]]) { - if (!types::check(n, ValueType::Any)) - throw types::TypeCheckingError( - "math:Inf?", - { { types::Contract { { types::Typedef("value", ValueType::Any) } } } }, - n); - if (n[0].valueType() != ValueType::Number) return falseSym; diff --git a/src/arkreactor/VM/VM.cpp b/src/arkreactor/VM/VM.cpp index 9875ce69..c7d0973b 100644 --- a/src/arkreactor/VM/VM.cpp +++ b/src/arkreactor/VM/VM.cpp @@ -1696,7 +1696,7 @@ namespace Ark } else if (consecutive_similar_traces == 0) { - fmt::println("{0:^{1}}", "...", 21 + func_name.size() + loc_as_text.size()); + fmt::println(os, " ..."); ++consecutive_similar_traces; } diff --git a/tests/unittests/resources/DiagnosticsSuite/runtime/mathln_out_of_range.ark b/tests/unittests/resources/DiagnosticsSuite/runtime/mathln_out_of_range.ark new file mode 100644 index 00000000..e24171f2 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/runtime/mathln_out_of_range.ark @@ -0,0 +1 @@ +(math:ln -1) diff --git a/tests/unittests/resources/DiagnosticsSuite/runtime/mathln_out_of_range.expected b/tests/unittests/resources/DiagnosticsSuite/runtime/mathln_out_of_range.expected new file mode 100644 index 00000000..830889b4 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/runtime/mathln_out_of_range.expected @@ -0,0 +1,6 @@ +math:ln: value -1 must be greater than 0 + +In file tests/unittests/resources/DiagnosticsSuite/runtime/mathln_out_of_range.ark + 1 | (math:ln -1) + | ^~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/runtime/recursion_depth.expected b/tests/unittests/resources/DiagnosticsSuite/runtime/recursion_depth.expected index 55bae592..7187fda3 100644 --- a/tests/unittests/resources/DiagnosticsSuite/runtime/recursion_depth.expected +++ b/tests/unittests/resources/DiagnosticsSuite/runtime/recursion_depth.expected @@ -9,6 +9,7 @@ In file tests/unittests/resources/DiagnosticsSuite/runtime/recursion_depth.ark 5 | })) [2047] In function `foo' (tests/unittests/resources/DiagnosticsSuite/runtime/recursion_depth.ark:3) + ... [ 1] In global scope (tests/unittests/resources/DiagnosticsSuite/runtime/recursion_depth.ark:7) Current scope variables values: diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/await_num.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/await_num.ark new file mode 100644 index 00000000..a9e1f78a --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/await_num.ark @@ -0,0 +1 @@ +(await 1) diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/await_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/await_num.expected new file mode 100644 index 00000000..d6d7a394 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/await_num.expected @@ -0,0 +1,7 @@ +Function await expected 1 argument + -> future (UserType) was of type Number + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/await_num.ark + 1 | (await 1) + | ^~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioappendtofile_num_num.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioappendtofile_num_num.ark new file mode 100644 index 00000000..d9585f1a --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioappendtofile_num_num.ark @@ -0,0 +1 @@ +(io:appendToFile 1 2) diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioappendtofile_num_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioappendtofile_num_num.expected new file mode 100644 index 00000000..f473fbd3 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioappendtofile_num_num.expected @@ -0,0 +1,8 @@ +Function io:appendToFile expected 2 arguments + -> filename (String) was of type Number + -> content (any) + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/ioappendtofile_num_num.ark + 1 | (io:appendToFile 1 2) + | ^~~~~~~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/iodir_num.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iodir_num.ark new file mode 100644 index 00000000..e198ee0a --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iodir_num.ark @@ -0,0 +1 @@ +(io:dir? 1) diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/iodir_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iodir_num.expected new file mode 100644 index 00000000..360f34a3 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iodir_num.expected @@ -0,0 +1,7 @@ +Function io:dir? expected 1 argument + -> path (String) was of type Number + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/iodir_num.ark + 1 | (io:dir? 1) + | ^~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/iofileexists_num.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iofileexists_num.ark new file mode 100644 index 00000000..9ec4c061 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iofileexists_num.ark @@ -0,0 +1 @@ +(io:fileExists? 1) diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/iofileexists_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iofileexists_num.expected new file mode 100644 index 00000000..d95c7997 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iofileexists_num.expected @@ -0,0 +1,7 @@ +Function io:fileExists? expected 1 argument + -> filename (String) was of type Number + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/iofileexists_num.ark + 1 | (io:fileExists? 1) + | ^~~~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/iolistfiles_num.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iolistfiles_num.ark new file mode 100644 index 00000000..343b81fc --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iolistfiles_num.ark @@ -0,0 +1 @@ +(io:listFiles 1) diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/iolistfiles_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iolistfiles_num.expected new file mode 100644 index 00000000..a2af6fd1 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iolistfiles_num.expected @@ -0,0 +1,7 @@ +Function io:listFiles expected 1 argument + -> path (String) was of type Number + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/iolistfiles_num.ark + 1 | (io:listFiles 1) + | ^~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/iomakedir_num.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iomakedir_num.ark new file mode 100644 index 00000000..949bb8f6 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iomakedir_num.ark @@ -0,0 +1 @@ +(io:makeDir 1) diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/iomakedir_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iomakedir_num.expected new file mode 100644 index 00000000..4c7e97c7 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iomakedir_num.expected @@ -0,0 +1,7 @@ +Function io:makeDir expected 1 argument + -> path (String) was of type Number + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/iomakedir_num.ark + 1 | (io:makeDir 1) + | ^~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadfile_inexistent.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadfile_inexistent.ark new file mode 100644 index 00000000..2d5a58d5 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadfile_inexistent.ark @@ -0,0 +1 @@ +(io:readFile "non-existing-file.weird") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadfile_inexistent.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadfile_inexistent.expected new file mode 100644 index 00000000..2721850d --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadfile_inexistent.expected @@ -0,0 +1,6 @@ +io:readFile: couldn't read file "non-existing-file.weird" because it doesn't exist + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadfile_inexistent.ark + 1 | (io:readFile "non-existing-file.weird") + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadfile_num.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadfile_num.ark new file mode 100644 index 00000000..5ab23316 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadfile_num.ark @@ -0,0 +1 @@ +(io:readFile 1) diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadfile_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadfile_num.expected new file mode 100644 index 00000000..252a28d4 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadfile_num.expected @@ -0,0 +1,7 @@ +Function io:readFile expected 1 argument + -> filename (String) was of type Number + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadfile_num.ark + 1 | (io:readFile 1) + | ^~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioremovefiles_num.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioremovefiles_num.ark new file mode 100644 index 00000000..b2ae661f --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioremovefiles_num.ark @@ -0,0 +1 @@ +(io:removeFiles 1) diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioremovefiles_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioremovefiles_num.expected new file mode 100644 index 00000000..50ad86c4 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioremovefiles_num.expected @@ -0,0 +1,8 @@ +Function io:removeFiles expected 2 arguments but got 1 + -> filename (String) was of type Number + -> variadic filenames (String) was not provided + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/ioremovefiles_num.ark + 1 | (io:removeFiles 1) + | ^~~~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioremovefiles_str_num.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioremovefiles_str_num.ark new file mode 100644 index 00000000..e2f5a41b --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioremovefiles_str_num.ark @@ -0,0 +1,2 @@ +(io:writeFile "hello" "content") +(io:removeFiles "hello" 1) diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioremovefiles_str_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioremovefiles_str_num.expected new file mode 100644 index 00000000..ea23c11b --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioremovefiles_str_num.expected @@ -0,0 +1,9 @@ +Function io:removeFiles expected 2 arguments + -> filename (String) + -> variadic filenames (String) 1 argument do not match + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/ioremovefiles_str_num.ark + 1 | (io:writeFile "hello" "content") + 2 | (io:removeFiles "hello" 1) + | ^~~~~~~~~~~~~~~~~~~~~~~~~ + 3 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/iowritefile_num_num.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iowritefile_num_num.ark new file mode 100644 index 00000000..742e76ba --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iowritefile_num_num.ark @@ -0,0 +1 @@ +(io:writeFile 1 2) diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/iowritefile_num_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iowritefile_num_num.expected new file mode 100644 index 00000000..b6125d33 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iowritefile_num_num.expected @@ -0,0 +1,8 @@ +Function io:writeFile expected 2 arguments + -> filename (String) was of type Number + -> content (any) + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/iowritefile_num_num.ark + 1 | (io:writeFile 1 2) + | ^~~~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listfill_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listfill_str.ark new file mode 100644 index 00000000..18a2ca62 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listfill_str.ark @@ -0,0 +1 @@ +(list:fill "hello") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listfill_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listfill_str.expected new file mode 100644 index 00000000..fb0ddfe6 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listfill_str.expected @@ -0,0 +1,8 @@ +Function list:fill expected 2 arguments but got 1 + -> size (Number) was of type String + -> value (any) was not provided + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/listfill_str.ark + 1 | (list:fill "hello") + | ^~~~~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listfind_str_num.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listfind_str_num.ark new file mode 100644 index 00000000..3198318b --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listfind_str_num.ark @@ -0,0 +1 @@ +(list:find "hello" 1) diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listfind_str_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listfind_str_num.expected new file mode 100644 index 00000000..4aba3afc --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listfind_str_num.expected @@ -0,0 +1,8 @@ +Function list:find expected 2 arguments + -> list (List) was of type String + -> value (any) + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/listfind_str_num.ark + 1 | (list:find "hello" 1) + | ^~~~~~~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listreverse_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listreverse_str.ark new file mode 100644 index 00000000..9d7716b5 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listreverse_str.ark @@ -0,0 +1 @@ +(list:reverse "hello") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listreverse_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listreverse_str.expected new file mode 100644 index 00000000..323f62b9 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listreverse_str.expected @@ -0,0 +1,7 @@ +Function list:reverse expected 1 argument + -> list (List) was of type String + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/listreverse_str.ark + 1 | (list:reverse "hello") + | ^~~~~~~~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listsetat_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listsetat_str.ark new file mode 100644 index 00000000..652d4c36 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listsetat_str.ark @@ -0,0 +1 @@ +(list:setAt "hello") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listsetat_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listsetat_str.expected new file mode 100644 index 00000000..97c7268e --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listsetat_str.expected @@ -0,0 +1,9 @@ +Function list:setAt expected 3 arguments but got 1 + -> list (List) was of type String + -> index (Number) was not provided + -> value (any) was not provided + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/listsetat_str.ark + 1 | (list:setAt "hello") + | ^~~~~~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listslice_str_num_bool_nil.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listslice_str_num_bool_nil.ark new file mode 100644 index 00000000..10a213bb --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listslice_str_num_bool_nil.ark @@ -0,0 +1 @@ +(list:slice "hello" 1 true nil) diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listslice_str_num_bool_nil.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listslice_str_num_bool_nil.expected new file mode 100644 index 00000000..8f957a4e --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listslice_str_num_bool_nil.expected @@ -0,0 +1,10 @@ +Function list:slice expected 4 arguments + -> list (List) was of type String + -> start (Number) + -> end (Number) was of type Bool + -> step (Number) was of type Nil + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/listslice_str_num_bool_nil.ark + 1 | (list:slice "hello" 1 true nil) + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listsort_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listsort_str.ark new file mode 100644 index 00000000..bd47a615 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listsort_str.ark @@ -0,0 +1 @@ +(list:sort "hello") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listsort_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listsort_str.expected new file mode 100644 index 00000000..8e9e6160 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listsort_str.expected @@ -0,0 +1,7 @@ +Function list:sort expected 1 argument + -> list (List) was of type String + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/listsort_str.ark + 1 | (list:sort "hello") + | ^~~~~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathacosh_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathacosh_str.ark new file mode 100644 index 00000000..1b7ed80e --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathacosh_str.ark @@ -0,0 +1 @@ +(math:acosh "1") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathacosh_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathacosh_str.expected new file mode 100644 index 00000000..e3c8c359 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathacosh_str.expected @@ -0,0 +1,7 @@ +Function math:acosh expected 1 argument + -> value (Number) was of type String + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathacosh_str.ark + 1 | (math:acosh "1") + | ^~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharccos_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharccos_str.ark new file mode 100644 index 00000000..8ff5cf52 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharccos_str.ark @@ -0,0 +1 @@ +(math:arccos "1") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharccos_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharccos_str.expected new file mode 100644 index 00000000..943d9854 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharccos_str.expected @@ -0,0 +1,7 @@ +Function math:arccos expected 1 argument + -> value (Number) was of type String + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/matharccos_str.ark + 1 | (math:arccos "1") + | ^~~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharcsin_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharcsin_str.ark new file mode 100644 index 00000000..a0a4e685 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharcsin_str.ark @@ -0,0 +1 @@ +(math:arcsin "1") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharcsin_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharcsin_str.expected new file mode 100644 index 00000000..99c10057 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharcsin_str.expected @@ -0,0 +1,7 @@ +Function math:arcsin expected 1 argument + -> value (Number) was of type String + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/matharcsin_str.ark + 1 | (math:arcsin "1") + | ^~~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharctan_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharctan_str.ark new file mode 100644 index 00000000..71a39a42 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharctan_str.ark @@ -0,0 +1 @@ +(math:arctan "1") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharctan_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharctan_str.expected new file mode 100644 index 00000000..aaaedb52 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharctan_str.expected @@ -0,0 +1,7 @@ +Function math:arctan expected 1 argument + -> value (Number) was of type String + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/matharctan_str.ark + 1 | (math:arctan "1") + | ^~~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathasinh_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathasinh_str.ark new file mode 100644 index 00000000..9ba00abe --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathasinh_str.ark @@ -0,0 +1 @@ +(math:asinh "1") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathasinh_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathasinh_str.expected new file mode 100644 index 00000000..557d2965 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathasinh_str.expected @@ -0,0 +1,7 @@ +Function math:asinh expected 1 argument + -> value (Number) was of type String + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathasinh_str.ark + 1 | (math:asinh "1") + | ^~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathatanh_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathatanh_str.ark new file mode 100644 index 00000000..654aad8d --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathatanh_str.ark @@ -0,0 +1 @@ +(math:atanh "1") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathatanh_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathatanh_str.expected new file mode 100644 index 00000000..0103c742 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathatanh_str.expected @@ -0,0 +1,7 @@ +Function math:atanh expected 1 argument + -> value (Number) was of type String + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathatanh_str.ark + 1 | (math:atanh "1") + | ^~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathceil_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathceil_str.ark new file mode 100644 index 00000000..270c9ace --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathceil_str.ark @@ -0,0 +1 @@ +(math:ceil "1") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathceil_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathceil_str.expected new file mode 100644 index 00000000..4bdce459 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathceil_str.expected @@ -0,0 +1,7 @@ +Function math:ceil expected 1 argument + -> value (Number) was of type String + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathceil_str.ark + 1 | (math:ceil "1") + | ^~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcos_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcos_str.ark new file mode 100644 index 00000000..7366358f --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcos_str.ark @@ -0,0 +1 @@ +(math:cos "1") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcos_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcos_str.expected new file mode 100644 index 00000000..ea1e82d4 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcos_str.expected @@ -0,0 +1,7 @@ +Function math:cos expected 1 argument + -> value (Number) was of type String + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcos_str.ark + 1 | (math:cos "1") + | ^~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcosh_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcosh_str.ark new file mode 100644 index 00000000..f01df2cb --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcosh_str.ark @@ -0,0 +1 @@ +(math:cosh "1") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcosh_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcosh_str.expected new file mode 100644 index 00000000..0aa9b2d1 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcosh_str.expected @@ -0,0 +1,7 @@ +Function math:cosh expected 1 argument + -> value (Number) was of type String + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcosh_str.ark + 1 | (math:cosh "1") + | ^~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathexp_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathexp_str.ark new file mode 100644 index 00000000..f13daa4a --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathexp_str.ark @@ -0,0 +1 @@ +(math:exp "1") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathexp_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathexp_str.expected new file mode 100644 index 00000000..012be07a --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathexp_str.expected @@ -0,0 +1,7 @@ +Function math:exp expected 1 argument + -> value (Number) was of type String + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathexp_str.ark + 1 | (math:exp "1") + | ^~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathfloor_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathfloor_str.ark new file mode 100644 index 00000000..c9d55113 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathfloor_str.ark @@ -0,0 +1 @@ +(math:floor "1") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathfloor_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathfloor_str.expected new file mode 100644 index 00000000..79a4fd93 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathfloor_str.expected @@ -0,0 +1,7 @@ +Function math:floor expected 1 argument + -> value (Number) was of type String + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathfloor_str.ark + 1 | (math:floor "1") + | ^~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathln_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathln_str.ark new file mode 100644 index 00000000..3f908ba9 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathln_str.ark @@ -0,0 +1 @@ +(math:ln "1") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathln_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathln_str.expected new file mode 100644 index 00000000..00a01c4d --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathln_str.expected @@ -0,0 +1,7 @@ +Function math:ln expected 1 argument + -> value (Number) was of type String + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathln_str.ark + 1 | (math:ln "1") + | ^~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathround_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathround_str.ark new file mode 100644 index 00000000..2ea80361 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathround_str.ark @@ -0,0 +1 @@ +(math:round "1") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathround_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathround_str.expected new file mode 100644 index 00000000..dba3ad3f --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathround_str.expected @@ -0,0 +1,7 @@ +Function math:round expected 1 argument + -> value (Number) was of type String + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathround_str.ark + 1 | (math:round "1") + | ^~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsin_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsin_str.ark new file mode 100644 index 00000000..351892d5 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsin_str.ark @@ -0,0 +1 @@ +(math:sin "1") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsin_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsin_str.expected new file mode 100644 index 00000000..0a45daab --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsin_str.expected @@ -0,0 +1,7 @@ +Function math:sin expected 1 argument + -> value (Number) was of type String + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsin_str.ark + 1 | (math:sin "1") + | ^~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsinh_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsinh_str.ark new file mode 100644 index 00000000..f1f641c6 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsinh_str.ark @@ -0,0 +1 @@ +(math:sinh "1") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsinh_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsinh_str.expected new file mode 100644 index 00000000..fc317fcc --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsinh_str.expected @@ -0,0 +1,7 @@ +Function math:sinh expected 1 argument + -> value (Number) was of type String + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsinh_str.ark + 1 | (math:sinh "1") + | ^~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtan_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtan_str.ark new file mode 100644 index 00000000..7fd5c480 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtan_str.ark @@ -0,0 +1 @@ +(math:tan "1") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtan_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtan_str.expected new file mode 100644 index 00000000..c817db9a --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtan_str.expected @@ -0,0 +1,7 @@ +Function math:tan expected 1 argument + -> value (Number) was of type String + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtan_str.ark + 1 | (math:tan "1") + | ^~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtanh_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtanh_str.ark new file mode 100644 index 00000000..241e3fc7 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtanh_str.ark @@ -0,0 +1 @@ +(math:tanh "1") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtanh_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtanh_str.expected new file mode 100644 index 00000000..4a003d7f --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtanh_str.expected @@ -0,0 +1,7 @@ +Function math:tanh expected 1 argument + -> value (Number) was of type String + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtanh_str.ark + 1 | (math:tanh "1") + | ^~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/random_str_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/random_str_str.ark new file mode 100644 index 00000000..4b2c8379 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/random_str_str.ark @@ -0,0 +1 @@ +(random "1" "2") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/random_str_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/random_str_str.expected new file mode 100644 index 00000000..ed85625c --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/random_str_str.expected @@ -0,0 +1,8 @@ +Function random expected 2 arguments + -> min (Number) was of type String + -> max (Number) was of type String + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/random_str_str.ark + 1 | (random "1" "2") + | ^~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringchr_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringchr_str.ark new file mode 100644 index 00000000..33c0f698 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringchr_str.ark @@ -0,0 +1 @@ +(string:chr "1") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringchr_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringchr_str.expected new file mode 100644 index 00000000..f2056783 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringchr_str.expected @@ -0,0 +1,7 @@ +Function string:chr expected 1 argument + -> codepoint (Number) was of type String + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/stringchr_str.ark + 1 | (string:chr "1") + | ^~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringfind_num.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringfind_num.ark new file mode 100644 index 00000000..c794d6da --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringfind_num.ark @@ -0,0 +1 @@ +(string:find 1) diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringfind_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringfind_num.expected new file mode 100644 index 00000000..d5923ef8 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringfind_num.expected @@ -0,0 +1,12 @@ +Function string:find expected between 2 arguments and 3 arguments but got 1 + -> string (String) was of type Number + -> substr (String) was not provided +Alternative 2: + -> string (String) was of type Number + -> substr (String) was not provided + -> startIndex (Number) was not provided + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/stringfind_num.ark + 1 | (string:find 1) + | ^~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringformat_num.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringformat_num.ark new file mode 100644 index 00000000..abcee716 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringformat_num.ark @@ -0,0 +1 @@ +(string:format 1) diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringformat_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringformat_num.expected new file mode 100644 index 00000000..a2ce1ab2 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringformat_num.expected @@ -0,0 +1,8 @@ +Function string:format expected 2 arguments but got 1 + -> string (String) was of type Number + -> variadic value (any) was not provided + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/stringformat_num.ark + 1 | (string:format 1) + | ^~~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringord_num.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringord_num.ark new file mode 100644 index 00000000..42348bff --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringord_num.ark @@ -0,0 +1 @@ +(string:ord 1) diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringord_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringord_num.expected new file mode 100644 index 00000000..ad943ced --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringord_num.expected @@ -0,0 +1,7 @@ +Function string:ord expected 1 argument + -> string (String) was of type Number + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/stringord_num.ark + 1 | (string:ord 1) + | ^~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringremoveat_num.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringremoveat_num.ark new file mode 100644 index 00000000..0b81fc50 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringremoveat_num.ark @@ -0,0 +1 @@ +(string:removeAt 1) diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringremoveat_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringremoveat_num.expected new file mode 100644 index 00000000..47e36487 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringremoveat_num.expected @@ -0,0 +1,8 @@ +Function string:removeAt expected 2 arguments but got 1 + -> string (String) was of type Number + -> index (Number) was not provided + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/stringremoveat_num.ark + 1 | (string:removeAt 1) + | ^~~~~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringsetat_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringsetat_str.ark new file mode 100644 index 00000000..fc8b8604 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringsetat_str.ark @@ -0,0 +1 @@ +(string:setAt "1") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringsetat_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringsetat_str.expected new file mode 100644 index 00000000..b43f170a --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringsetat_str.expected @@ -0,0 +1,9 @@ +Function string:setAt expected 3 arguments but got 1 + -> string (String) + -> index (Number) was not provided + -> value (String) was not provided + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/stringsetat_str.ark + 1 | (string:setAt "1") + | ^~~~~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/syssleep_str.ark b/tests/unittests/resources/DiagnosticsSuite/typeChecking/syssleep_str.ark new file mode 100644 index 00000000..e18e8d72 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/syssleep_str.ark @@ -0,0 +1 @@ +(sys:sleep "1") diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/syssleep_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/syssleep_str.expected new file mode 100644 index 00000000..f36d4349 --- /dev/null +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/syssleep_str.expected @@ -0,0 +1,7 @@ +Function sys:sleep expected 1 argument + -> duration (Number) was of type String + +In file tests/unittests/resources/DiagnosticsSuite/typeChecking/syssleep_str.ark + 1 | (sys:sleep "1") + | ^~~~~~~~~~~~~~ + 2 | diff --git a/tests/unittests/resources/LangSuite/builtins-tests.ark b/tests/unittests/resources/LangSuite/builtins-tests.ark index 4e824b0e..75eb7509 100644 --- a/tests/unittests/resources/LangSuite/builtins-tests.ark +++ b/tests/unittests/resources/LangSuite/builtins-tests.ark @@ -52,8 +52,16 @@ (not (list:any rands (fun (e) (or (< e 0) (> e 10))))) "should not find any number outside the given range") - # no need to test the math functions since they're 1:1 binding of C++ functions and were carefully checked + (let r (random)) + (test:expect (and (<= r 2147483647) (>= r -2147483648))) + + # no need to test all the math functions since they're 1:1 binding of C++ functions and were carefully checked # before writing this comment, to ensure we aren't binding math:sin to the C++ tan function + (test:case "math" { + (test:expect (not (math:NaN? 1))) + (test:expect (math:NaN? math:NaN)) + (test:expect (not (math:Inf? 100000))) + (test:expect (math:Inf? math:Inf)) }) # clean up (io:removeFiles "test.txt" "temp/") })