add: test to strlen
This commit is contained in:
parent
8af591f1db
commit
59be7cdd0d
8
tests/strlen.🗿
Normal file
8
tests/strlen.🗿
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
main()
|
||||||
|
{
|
||||||
|
local str;
|
||||||
|
name = "strlen";
|
||||||
|
str = "bozoman du 36";
|
||||||
|
test(strlen(str), 13, "");
|
||||||
|
test(strlen(""), 0, "Empty string");
|
||||||
|
}
|
@ -1,3 +1,5 @@
|
|||||||
|
global name;
|
||||||
|
|
||||||
putstr(str){
|
putstr(str){
|
||||||
local i;
|
local i;
|
||||||
i = 0;
|
i = 0;
|
||||||
@ -9,14 +11,14 @@ putstr(str){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
test(value, reach_value, error_message)
|
test(value, reach_value, description)
|
||||||
{
|
{
|
||||||
putstr(name);
|
putstr(name);
|
||||||
if (value != reach_value)
|
if (value != reach_value)
|
||||||
{
|
{
|
||||||
putstr(": ERROR: ");
|
putstr(": ERROR: ");
|
||||||
putstr(", ");
|
putstr(", ");
|
||||||
putstr(error_message);
|
putstr(description);
|
||||||
putstr(" [");
|
putstr(" [");
|
||||||
putstr(reach_value);
|
putstr(reach_value);
|
||||||
putstr(" != ");
|
putstr(" != ");
|
||||||
@ -26,6 +28,7 @@ test(value, reach_value, error_message)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
putstr(": OK: ");
|
putstr(": OK: ");
|
||||||
|
putstr(description);
|
||||||
}
|
}
|
||||||
wrt '\n';
|
wrt '\n';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user