summary refs log tree commit diff
path: root/lib/tests
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2020-11-16 09:01:53 +0100
committerFrederik Rietdijk <fridh@fridh.nl>2020-11-16 09:01:53 +0100
commit986c2d36da97856f392dd66d265b7646b32fa3b9 (patch)
treecaac503026c928b9dacd517c229e234dc66d47f6 /lib/tests
parentda6239dab3d712aa335fd0928c4e64f9599fef73 (diff)
parent300846f3c982ffc3e54775fa99b4ec01d56adf65 (diff)
downloadnixpkgs-986c2d36da97856f392dd66d265b7646b32fa3b9.tar
nixpkgs-986c2d36da97856f392dd66d265b7646b32fa3b9.tar.gz
nixpkgs-986c2d36da97856f392dd66d265b7646b32fa3b9.tar.bz2
nixpkgs-986c2d36da97856f392dd66d265b7646b32fa3b9.tar.lz
nixpkgs-986c2d36da97856f392dd66d265b7646b32fa3b9.tar.xz
nixpkgs-986c2d36da97856f392dd66d265b7646b32fa3b9.tar.zst
nixpkgs-986c2d36da97856f392dd66d265b7646b32fa3b9.zip
Merge master into staging-next
Diffstat (limited to 'lib/tests')
-rw-r--r--lib/tests/misc.nix20
-rw-r--r--lib/tests/systems.nix6
2 files changed, 24 insertions, 2 deletions
diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix
index 6175f15819a..35a5801c724 100644
--- a/lib/tests/misc.nix
+++ b/lib/tests/misc.nix
@@ -87,6 +87,26 @@ runTests {
     expected = true;
   };
 
+  testComposeManyExtensions0 = {
+    expr = let obj = makeExtensible (self: { foo = true; });
+               emptyComposition = composeManyExtensions [];
+               composed = obj.extend emptyComposition;
+           in composed.foo;
+    expected = true;
+  };
+
+  testComposeManyExtensions =
+    let f = self: super: { bar = false; baz = true; };
+        g = self: super: { bar = super.baz or false; };
+        h = self: super: { qux = super.bar or false; };
+        obj = makeExtensible (self: { foo = self.qux; });
+    in {
+    expr = let composition = composeManyExtensions [f g h];
+               composed = obj.extend composition;
+           in composed.foo;
+    expected = (obj.extend (composeExtensions f (composeExtensions g h))).foo;
+  };
+
   testBitAnd = {
     expr = (bitAnd 3 10);
     expected = 2;
diff --git a/lib/tests/systems.nix b/lib/tests/systems.nix
index f691b2da316..eed7ee725bc 100644
--- a/lib/tests/systems.nix
+++ b/lib/tests/systems.nix
@@ -11,12 +11,14 @@ let
     expr     = lib.sort lib.lessThan x;
     expected = lib.sort lib.lessThan y;
   };
-in with lib.systems.doubles; lib.runTests {
-  testall = mseteq all (linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos ++ wasi ++ windows ++ embedded ++ js ++ genode ++ redox);
+in
+with lib.systems.doubles; lib.runTests {
+  testall = mseteq all (linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos ++ wasi ++ windows ++ embedded ++ mmix ++ js ++ genode ++ redox);
 
   testarm = mseteq arm [ "armv5tel-linux" "armv6l-linux" "armv6l-none" "armv7a-linux" "armv7l-linux" "arm-none" "armv7a-darwin" ];
   testi686 = mseteq i686 [ "i686-linux" "i686-freebsd" "i686-genode" "i686-netbsd" "i686-openbsd" "i686-cygwin" "i686-windows" "i686-none" "i686-darwin" ];
   testmips = mseteq mips [ "mipsel-linux" ];
+  testmmix = mseteq mmix [ "mmix-mmixware" ];
   testx86_64 = mseteq x86_64 [ "x86_64-linux" "x86_64-darwin" "x86_64-freebsd" "x86_64-genode" "x86_64-redox" "x86_64-openbsd" "x86_64-netbsd" "x86_64-cygwin" "x86_64-solaris" "x86_64-windows" "x86_64-none" ];
 
   testcygwin = mseteq cygwin [ "i686-cygwin" "x86_64-cygwin" ];