lib.removePrefix: Add tests
This commit is contained in:
parent
b91a4d8db4
commit
8fab18d4c1
|
@ -349,6 +349,27 @@ runTests {
|
|||
expected = true;
|
||||
};
|
||||
|
||||
testRemovePrefixExample1 = {
|
||||
expr = removePrefix "foo." "foo.bar.baz";
|
||||
expected = "bar.baz";
|
||||
};
|
||||
testRemovePrefixExample2 = {
|
||||
expr = removePrefix "xxx" "foo.bar.baz";
|
||||
expected = "foo.bar.baz";
|
||||
};
|
||||
testRemovePrefixEmptyPrefix = {
|
||||
expr = removePrefix "" "foo";
|
||||
expected = "foo";
|
||||
};
|
||||
testRemovePrefixEmptyString = {
|
||||
expr = removePrefix "foo" "";
|
||||
expected = "";
|
||||
};
|
||||
testRemovePrefixEmptyBoth = {
|
||||
expr = removePrefix "" "";
|
||||
expected = "";
|
||||
};
|
||||
|
||||
testNormalizePath = {
|
||||
expr = strings.normalizePath "//a/b//c////d/";
|
||||
expected = "/a/b/c/d/";
|
||||
|
|
Loading…
Reference in New Issue
Block a user