summary refs log tree commit diff
path: root/lib/tests
diff options
context:
space:
mode:
authorvolth <volth@webmaster.ms>2018-06-10 19:25:48 +0000
committerxeji <36407913+xeji@users.noreply.github.com>2018-06-10 21:25:48 +0200
commit3c2bbe217c4bbc67cfdf3912317d5a19b3994f69 (patch)
tree49b7e480abe63303733e6f284fe350bb4acb74ae /lib/tests
parente544e4f564f69c89fc38fbd161648084b4f57c4f (diff)
downloadnixpkgs-3c2bbe217c4bbc67cfdf3912317d5a19b3994f69.tar
nixpkgs-3c2bbe217c4bbc67cfdf3912317d5a19b3994f69.tar.gz
nixpkgs-3c2bbe217c4bbc67cfdf3912317d5a19b3994f69.tar.bz2
nixpkgs-3c2bbe217c4bbc67cfdf3912317d5a19b3994f69.tar.lz
nixpkgs-3c2bbe217c4bbc67cfdf3912317d5a19b3994f69.tar.xz
nixpkgs-3c2bbe217c4bbc67cfdf3912317d5a19b3994f69.tar.zst
nixpkgs-3c2bbe217c4bbc67cfdf3912317d5a19b3994f69.zip
lib: bitAnd, bitOr, bitXor (bitsize-agnostic fallback function) (#41491)
* lib: bitAnd, bitOr, bitXor

* lib: test for bitAnd, bitOr, bitXor

* lib: bitsize-agnostic zipIntBits

* lib: bitNot

* lib: bitNot
Diffstat (limited to 'lib/tests')
-rw-r--r--lib/tests/misc.nix15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix
index c683df7d7ca..eab20d0f14d 100644
--- a/lib/tests/misc.nix
+++ b/lib/tests/misc.nix
@@ -45,6 +45,21 @@ runTests {
     expected = true;
   };
 
+  testBitAnd = {
+    expr = (bitAnd 3 10);
+    expected = 2;
+  };
+
+  testBitOr = {
+    expr = (bitOr 3 10);
+    expected = 11;
+  };
+
+  testBitXor = {
+    expr = (bitXor 3 10);
+    expected = 9;
+  };
+
 # STRINGS
 
   testConcatMapStrings = {