expose _str_cmp as substr_match and doc tweaks

This commit is contained in:
Adrian Mariano
2022-08-14 20:33:31 -04:00
parent b9713845f7
commit 07805a1918
2 changed files with 60 additions and 30 deletions

View File

@@ -21,6 +21,17 @@ module test_downcase() {
}
test_downcase();
module test_substr_match(){
assert(substr_match("abcde",2,"cd"));
assert(!substr_match("abcde",2,"cx"));
assert(!substr_match("abcde",2,"cdef"));
assert(!substr_match("abcde",-2,"cd"));
assert(!substr_match("abcde",19,"cd"));
assert(substr_match("abc",1,""));
assert(!substr_match("",0,"a"));
assert(substr_match("",0,""));
}
module test_starts_with() {
assert(!starts_with("", "abc"));