about summary refs log tree commit diff
path: root/third_party/nix/src/tests/lang/disabled
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-07-19T14·57+0100
committertazjin <mail@tazj.in>2020-07-19T16·33+0000
commit61a7b97c3927f28ef588196bc2efbd8c6cceb8c4 (patch)
treee1d5e5c273f1c0fcfce9df4044c346abf78ba59e /third_party/nix/src/tests/lang/disabled
parent97e649922542ef66c9d80cb1b41817ed07c2c5a6 (diff)
test(3p/nix): Enable output comparison for evaluator success tests r/1398
Enables loading of the expected output of evaluator tests from the
corresponding .exp files, and checks that the output matches.

This again leaves some tests behind in the disabled folder, but we now
have almost the entire suite up and running so I can get around to
cleaning up the disabled ones.

Other note: Some tests had XML output, despite not being related to
XML testing at all - I'm not sure why they chose to do this, but have
converted those test outputs to normal Nix instead.

We have a separate test suite for JSON & XML serialisation already,
which was contributed by andi-.

Change-Id: Id7c42c836edfec4c22db9d893e35489f3e6dd559
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1285
Tested-by: BuildkiteCI
Reviewed-by: isomer <isomer@tvl.fyi>
Reviewed-by: glittershark <grfn@gws.fyi>
Diffstat (limited to 'third_party/nix/src/tests/lang/disabled')
-rw-r--r--third_party/nix/src/tests/lang/disabled/README.txt2
-rw-r--r--third_party/nix/src/tests/lang/disabled/eval-okay-autoargs.exp1
-rw-r--r--third_party/nix/src/tests/lang/disabled/eval-okay-autoargs.nix15
-rw-r--r--third_party/nix/src/tests/lang/disabled/eval-okay-sort.nix8
-rw-r--r--third_party/nix/src/tests/lang/disabled/eval-okay-toxml.nix3
-rw-r--r--third_party/nix/src/tests/lang/disabled/eval-okay-xml.nix21
6 files changed, 49 insertions, 1 deletions
diff --git a/third_party/nix/src/tests/lang/disabled/README.txt b/third_party/nix/src/tests/lang/disabled/README.txt
index 3dbcbf4f0dd9..50225deb63a2 100644
--- a/third_party/nix/src/tests/lang/disabled/README.txt
+++ b/third_party/nix/src/tests/lang/disabled/README.txt
@@ -1,4 +1,4 @@
-These tests are disabeld primarily because the DummyStore used for
+These tests are disabled primarily because the DummyStore used for
 tests does not interact with real files on disk at the moment, but the
 tests expect it to.
 
diff --git a/third_party/nix/src/tests/lang/disabled/eval-okay-autoargs.exp b/third_party/nix/src/tests/lang/disabled/eval-okay-autoargs.exp
new file mode 100644
index 000000000000..7a8391786a09
--- /dev/null
+++ b/third_party/nix/src/tests/lang/disabled/eval-okay-autoargs.exp
@@ -0,0 +1 @@
+"xyzzy!xyzzy!foobar"
diff --git a/third_party/nix/src/tests/lang/disabled/eval-okay-autoargs.nix b/third_party/nix/src/tests/lang/disabled/eval-okay-autoargs.nix
new file mode 100644
index 000000000000..815f51b1d67a
--- /dev/null
+++ b/third_party/nix/src/tests/lang/disabled/eval-okay-autoargs.nix
@@ -0,0 +1,15 @@
+let
+
+  foobar = "foobar";
+
+in
+
+{ xyzzy2 ? xyzzy # mutually recursive args
+, xyzzy ? "blaat" # will be overridden by --argstr
+, fb ? foobar
+, lib # will be set by --arg
+}:
+
+{
+  result = lib.concat [xyzzy xyzzy2 fb];
+}
diff --git a/third_party/nix/src/tests/lang/disabled/eval-okay-sort.nix b/third_party/nix/src/tests/lang/disabled/eval-okay-sort.nix
new file mode 100644
index 000000000000..8299c3a4a3aa
--- /dev/null
+++ b/third_party/nix/src/tests/lang/disabled/eval-okay-sort.nix
@@ -0,0 +1,8 @@
+with builtins;
+
+[ (sort lessThan [ 483 249 526 147 42 77 ])
+  (sort (x: y: y < x) [ 483 249 526 147 42 77 ])
+  (sort lessThan [ "foo" "bar" "xyzzy" "fnord" ])
+  (sort (x: y: x.key < y.key)
+    [ { key = 1; value = "foo"; } { key = 2; value = "bar"; } { key = 1; value = "fnord"; } ]) 
+]
diff --git a/third_party/nix/src/tests/lang/disabled/eval-okay-toxml.nix b/third_party/nix/src/tests/lang/disabled/eval-okay-toxml.nix
new file mode 100644
index 000000000000..068c97a6c1b3
--- /dev/null
+++ b/third_party/nix/src/tests/lang/disabled/eval-okay-toxml.nix
@@ -0,0 +1,3 @@
+# Make sure the expected XML output is produced; in particular, make sure it
+# doesn't contain source location information.
+builtins.toXML { a = "s"; }
diff --git a/third_party/nix/src/tests/lang/disabled/eval-okay-xml.nix b/third_party/nix/src/tests/lang/disabled/eval-okay-xml.nix
new file mode 100644
index 000000000000..9ee9f8a0b4f5
--- /dev/null
+++ b/third_party/nix/src/tests/lang/disabled/eval-okay-xml.nix
@@ -0,0 +1,21 @@
+rec {
+
+  x = 123;
+
+  y = 567.890;
+
+  a = "foo";
+
+  b = "bar";
+
+  c = "foo" + "bar";
+
+  f = {z, x, y}: if y then x else z;
+
+  id = x: x;
+
+  at = args@{x, y, z}: x;
+
+  ellipsis = {x, y, z, ...}: x;
+
+}