about summary refs log tree commit diff
path: root/tests/structured-attrs.nix
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-10-25T12·08+0200
committerEelco Dolstra <edolstra@gmail.com>2017-10-25T12·08+0200
commit3395e3bbc4bc88a102600155ea996777669364ab (patch)
tree64b92889ad90ad406b828d70ffb1801b71bd9658 /tests/structured-attrs.nix
parent2d5b1b24bf70a498e4c0b378704cfdb6471cc699 (diff)
Fix exportReferencesGraph in the structured attrs case
Diffstat (limited to 'tests/structured-attrs.nix')
-rw-r--r--tests/structured-attrs.nix19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/structured-attrs.nix b/tests/structured-attrs.nix
index 2adc6b6c34f3..72e9c6747502 100644
--- a/tests/structured-attrs.nix
+++ b/tests/structured-attrs.nix
@@ -1,5 +1,16 @@
 with import ./config.nix;
 
+let
+
+  dep = mkDerivation {
+    name = "dep";
+    buildCommand = ''
+      mkdir $out; echo bla > $out/bla
+    '';
+  };
+
+in
+
 mkDerivation {
   name = "structured";
 
@@ -21,6 +32,12 @@ mkDerivation {
 
     mkdir ''${outputs[out]}
     echo bar > $dest
+
+    json=$(cat .attrs.json)
+    [[ $json =~ '"narHash":"sha256:1r7yc43zqnzl5b0als5vnyp649gk17i37s7mj00xr8kc47rjcybk"' ]]
+    [[ $json =~ '"narSize":288' ]]
+    [[ $json =~ '"closureSize":288' ]]
+    [[ $json =~ '"references":[]' ]]
   '';
 
   buildInputs = [ "a" "b" "c" 123 "'" "\"" null ];
@@ -44,4 +61,6 @@ mkDerivation {
   "foo bar" = "BAD";
   "1foobar" = "BAD";
   "foo$" = "BAD";
+
+  exportReferencesGraph.refs = dep;
 }