diff options
author | edef <edef@edef.eu> | 2024-04-04 14:05:18 +0000 |
---|---|---|
committer | edef <edef@edef.eu> | 2024-04-04 19:46:58 +0000 |
commit | 725bb4e48c6491598f53b83c2dcd1a307115c6cc (patch) | |
tree | 5e801c1cd8677cefd283e63ec3d0fc5484df98d4 /lib/tests | |
parent | d03a4482228d4d6dbd2d4b425b6dfcd49ebe765f (diff) |
lib: add xor
This gets clumsily reimplemented in various places, to no useful end.
Diffstat (limited to 'lib/tests')
-rw-r--r-- | lib/tests/misc.nix | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix index 3cb96c1b68bc2..9d2da7a639130 100644 --- a/lib/tests/misc.nix +++ b/lib/tests/misc.nix @@ -102,6 +102,7 @@ let types updateManyAttrsByPath versions + xor ; testingThrow = expr: { @@ -210,6 +211,21 @@ runTests { expected = false; }; + testXor = { + expr = [ + (xor true false) + (xor true true) + (xor false false) + (xor false true) + ]; + expected = [ + true + false + false + true + ]; + }; + testFix = { expr = fix (x: {a = if x ? a then "a" else "b";}); expected = {a = "a";}; |