summary refs log tree commit diff
path: root/lib/tests/modules
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2022-11-03 13:11:04 +0100
committerRobert Hensing <robert@roberthensing.nl>2022-11-03 13:12:58 +0100
commit1b6e5ac9520ebcfc283cd18c10856cdcd94c91eb (patch)
tree6dba8e2048eba07f40991183de1493d229f22924 /lib/tests/modules
parentad10d4fdef46a00bbe2d95aadc96b9e062fe0539 (diff)
downloadnixpkgs-1b6e5ac9520ebcfc283cd18c10856cdcd94c91eb.tar
nixpkgs-1b6e5ac9520ebcfc283cd18c10856cdcd94c91eb.tar.gz
nixpkgs-1b6e5ac9520ebcfc283cd18c10856cdcd94c91eb.tar.bz2
nixpkgs-1b6e5ac9520ebcfc283cd18c10856cdcd94c91eb.tar.lz
nixpkgs-1b6e5ac9520ebcfc283cd18c10856cdcd94c91eb.tar.xz
nixpkgs-1b6e5ac9520ebcfc283cd18c10856cdcd94c91eb.tar.zst
nixpkgs-1b6e5ac9520ebcfc283cd18c10856cdcd94c91eb.zip
lib/tests/modules: Test doRename
Diffstat (limited to 'lib/tests/modules')
-rw-r--r--lib/tests/modules/doRename-basic.nix11
-rw-r--r--lib/tests/modules/doRename-warnings.nix14
2 files changed, 25 insertions, 0 deletions
diff --git a/lib/tests/modules/doRename-basic.nix b/lib/tests/modules/doRename-basic.nix
new file mode 100644
index 00000000000..9d79fa4f26a
--- /dev/null
+++ b/lib/tests/modules/doRename-basic.nix
@@ -0,0 +1,11 @@
+{ lib, ... }: {
+  imports = [
+    (lib.doRename { from = ["a" "b"]; to = ["c" "d" "e"]; warn = true; use = x: x; visible = true; })
+  ];
+  options = {
+    c.d.e = lib.mkOption {};
+  };
+  config = {
+    a.b = 1234;
+  };
+}
diff --git a/lib/tests/modules/doRename-warnings.nix b/lib/tests/modules/doRename-warnings.nix
new file mode 100644
index 00000000000..6f0f1e87e3a
--- /dev/null
+++ b/lib/tests/modules/doRename-warnings.nix
@@ -0,0 +1,14 @@
+{ lib, config, ... }: {
+  imports = [
+    (lib.doRename { from = ["a" "b"]; to = ["c" "d" "e"]; warn = true; use = x: x; visible = true; })
+  ];
+  options = {
+    warnings = lib.mkOption { type = lib.types.listOf lib.types.str; };
+    c.d.e = lib.mkOption {};
+    result = lib.mkOption {};
+  };
+  config = {
+    a.b = 1234;
+    result = lib.concatStringsSep "%" config.warnings;
+  };
+}