wrote a simple test for libs

This commit is contained in:
2022-09-18 06:52:00 +01:00
parent 9c790f8cd6
commit 978e7cfac4
4 changed files with 158 additions and 1 deletions

View File

@@ -9,6 +9,7 @@
assert value == 42, "import/export failed";
}
//test functions using import/export
{
fn f() {
@@ -18,6 +19,7 @@
}
}
//test importing/exporting of functions
{
fn func() {
@@ -32,6 +34,7 @@
assert func() == 69, "import/export of functions failed";
}
//test that variables retain their types with the typeof keyword
{
var t: type = int;
@@ -45,4 +48,5 @@
assert typeof t == type, "type retention failed";
}
print "All good";

View File

@@ -0,0 +1,10 @@
//test the standard library
{
import standard;
//this depends on external factors, so only check the length
assert clock().length() == 24, "clock() import failed";
}
print "All good";