lib.removePrefix: Add tests

This commit is contained in:
Silvan Mosberger 2023-08-14 23:29:00 +02:00
parent b91a4d8db4
commit 8fab18d4c1

View File

@ -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/";