tvl-depot/users/sterni/nix/flow/tests/default.nix
sterni 8ff14cacb6 feat(users/sterni/nix): move flow.match to string.match
After all it only matches strings.

Change-Id: I3d2e5221ef43f692de69028e78ed98b6b11f82d1
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2586
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
2021-03-05 11:07:41 +00:00

39 lines
678 B
Nix

{ depot, ... }:
let
inherit (depot.nix.runTestsuite)
runTestsuite
it
assertEq
assertThrows
;
inherit (depot.users.sterni.nix.flow)
cond
match
;
dontEval = builtins.throw "this should not get evaluated";
testCond = it "tests cond" [
(assertThrows "malformed cond list"
(cond [ [ true 1 2 ] [ false 1 ] ]))
(assertEq "last is true" "last"
(cond [
[ false dontEval]
[ false dontEval ]
[ true "last" ]
]))
(assertEq "first is true" 1
(cond [
[ true 1 ]
[ true dontEval ]
[ true dontEval ]
]))
];
in
runTestsuite "nix.flow" [
testCond
]