lib/tests: add tests for hasInfix

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
main
Daniel Thwaites 2 years ago committed by Robert Hensing
parent e888c2133f
commit 7b5be1a0f8
  1. 30
      lib/tests/misc.nix

@ -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…
Cancel
Save