diff --git a/tests/strlen.🗿 b/tests/strlen.🗿 new file mode 100644 index 0000000..70ca382 --- /dev/null +++ b/tests/strlen.🗿 @@ -0,0 +1,8 @@ +main() +{ + local str; + name = "strlen"; + str = "bozoman du 36"; + test(strlen(str), 13, ""); + test(strlen(""), 0, "Empty string"); +} diff --git a/tests/test.🗿 b/tests/test.🗿 index d04b0df..8e67c52 100644 --- a/tests/test.🗿 +++ b/tests/test.🗿 @@ -1,3 +1,5 @@ +global name; + putstr(str){ local i; i = 0; @@ -9,14 +11,14 @@ putstr(str){ } } -test(value, reach_value, error_message) +test(value, reach_value, description) { putstr(name); if (value != reach_value) { putstr(": ERROR: "); putstr(", "); - putstr(error_message); + putstr(description); putstr(" ["); putstr(reach_value); putstr(" != "); @@ -26,6 +28,7 @@ test(value, reach_value, error_message) else { putstr(": OK: "); + putstr(description); } wrt '\n'; }