From 6c4b0e285875795168cac111c59e73ea4cc0895f Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Mon, 17 Feb 2025 18:42:59 +0100 Subject: [PATCH] pkgs-lib: Make tests independent of Nix file contents Before, all of these tests would be rebuilt whenever formats.nix is modified, but there's no need for this :) --- pkgs/pkgs-lib/tests/formats.nix | 12 ++++++------ pkgs/pkgs-lib/tests/testfile | 0 2 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 pkgs/pkgs-lib/tests/testfile diff --git a/pkgs/pkgs-lib/tests/formats.nix b/pkgs/pkgs-lib/tests/formats.nix index 523e19b2d01b..2a2138bdbd10 100644 --- a/pkgs/pkgs-lib/tests/formats.nix +++ b/pkgs/pkgs-lib/tests/formats.nix @@ -96,7 +96,7 @@ in runBuildTests { str = "foo"; attrs.foo = null; list = [ null null ]; - path = ./formats.nix; + path = ./testfile; }; expected = '' { @@ -111,7 +111,7 @@ in runBuildTests { null ], "null": null, - "path": "${./formats.nix}", + "path": "${./testfile}", "str": "foo", "true": true } @@ -128,7 +128,7 @@ in runBuildTests { str = "foo"; attrs.foo = null; list = [ null null ]; - path = ./formats.nix; + path = ./testfile; no = "no"; time = "22:30:00"; }; @@ -142,7 +142,7 @@ in runBuildTests { - null 'no': 'no' 'null': null - path: ${./formats.nix} + path: ${./testfile} str: foo time: '22:30:00' 'true': true @@ -547,7 +547,7 @@ in runBuildTests { 1 null ]; - path = ./formats.nix; + path = ./testfile; }; expected = '' attrs { @@ -561,7 +561,7 @@ in runBuildTests { null ] "null": null - "path": "${./formats.nix}" + "path": "${./testfile}" "str": "foo" "true": true ''; diff --git a/pkgs/pkgs-lib/tests/testfile b/pkgs/pkgs-lib/tests/testfile new file mode 100644 index 000000000000..e69de29bb2d1