summary refs log tree commit diff
path: root/checks.nix
diff options
context:
space:
mode:
Diffstat (limited to 'checks.nix')
-rw-r--r--checks.nix12
1 files changed, 9 insertions, 3 deletions
diff --git a/checks.nix b/checks.nix
index c20451a..3e1b773 100644
--- a/checks.nix
+++ b/checks.nix
@@ -98,7 +98,7 @@ let
                           sourceDerivations;
             };
 
-            nativeBuildInputs = with pkgs; [ diffutils nix ];
+            nativeBuildInputs = with pkgs; [ diffutils nix perl ];
 
             # Recall that a nix flake check is a derivation; the check
             # succeeds if and only if the derivation builds successfully.
@@ -113,10 +113,16 @@ let
                   --extra-experimental-features nix-command \
                   --store /build/nix-store \
                   --show-trace \
-                  eval --json --file $src/input.nix > $out
+                  eval --json --file $src/input.nix \
+                  | ${pkgs.perl}/bin/json_pp 2>/dev/null > $out
+
+              cat $src/expected.json \
+                  | ${pkgs.perl}/bin/json_pp 2>/dev/null \
+                  > expected-pretty.json
 
               # The exit code of diff is what we want for this. Yay!
-              if ! ${pkgs.diffutils}/bin/diff $src/expected.json $out; then
+              if ! ${pkgs.diffutils}/bin/diff -u expected-pretty.json $out
+              then
                 # It's good to keep the user-programmer in the loop...
                 echo
                 echo "This is a nix evaluation test case. The expected eval"