diff options
author | Daniel Thwaites <danthwaites30@btinternet.com> | 2022-04-27 07:58:20 +0100 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2022-05-02 09:05:56 +0200 |
commit | 7b5be1a0f8e8b0298dd71d78ec01de704d151f3b (patch) | |
tree | da8c070aa5879d5557c64e1b7d9c5fd5aa423cd3 /lib/tests | |
parent | e888c2133fb703d0161a6d7fb45f899289cb9729 (diff) | |
download | nixpkgs-7b5be1a0f8e8b0298dd71d78ec01de704d151f3b.tar nixpkgs-7b5be1a0f8e8b0298dd71d78ec01de704d151f3b.tar.gz nixpkgs-7b5be1a0f8e8b0298dd71d78ec01de704d151f3b.tar.bz2 nixpkgs-7b5be1a0f8e8b0298dd71d78ec01de704d151f3b.tar.lz nixpkgs-7b5be1a0f8e8b0298dd71d78ec01de704d151f3b.tar.xz nixpkgs-7b5be1a0f8e8b0298dd71d78ec01de704d151f3b.tar.zst nixpkgs-7b5be1a0f8e8b0298dd71d78ec01de704d151f3b.zip |
lib/tests: add tests for hasInfix
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
Diffstat (limited to 'lib/tests')
-rw-r--r-- | lib/tests/misc.nix | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix index c5d1d431677..a0be581d37f 100644 --- a/lib/tests/misc.nix +++ b/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 = { |