duckscript/test/std/string/last_indexof_test.ds
2020-01-31 14:41:31 +00:00

19 lines
301 B
Plaintext

fn test_not_found
output = last_indexof "1 2 3 4 5" "4 5 6"
assert_eq ${output} ""
end
fn test_prefix
output = last_indexof "1 2 3 4 5 1 2 3 4 5" "1 2"
assert_eq ${output} 10
end
fn test_suffix
output = last_indexof "1 2 3 4 5 1 2 3 4 5" "4 5"
assert_eq ${output} 16
end