lib/tests: add tests for hasInfix
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
This commit is contained in:
parent
e888c2133f
commit
7b5be1a0f8
@ -271,6 +271,36 @@ runTests {
|
||||
'';
|
||||
};
|
||||
|
||||
testHasInfixFalse = {
|
||||
expr = hasInfix "c" "abde";
|
||||
expected = false;
|
||||
};
|
||||
|
||||
testHasInfixTrue = {
|
||||
expr = hasInfix "c" "abcde";
|
||||
expected = true;
|
||||
};
|
||||
|
||||
testHasInfixDerivation = {
|
||||
expr = hasInfix "hello" (import ../.. { system = "x86_64-linux"; }).hello;
|
||||
expected = true;
|
||||
};
|
||||
|
||||
testHasInfixPath = {
|
||||
expr = hasInfix "tests" ./.;
|
||||
expected = true;
|
||||
};
|
||||
|
||||
testHasInfixPathStoreDir = {
|
||||
expr = hasInfix builtins.storeDir ./.;
|
||||
expected = true;
|
||||
};
|
||||
|
||||
testHasInfixToString = {
|
||||
expr = hasInfix "a" { __toString = _: "a"; };
|
||||
expected = true;
|
||||
};
|
||||
|
||||
# LISTS
|
||||
|
||||
testFilter = {
|
||||
|
Loading…
Reference in New Issue
Block a user