From 9d8a80375d2d0581b53d270eb4d543fa0d3f0190 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 17 Oct 2013 00:45:16 +0200 Subject: Add a test for type correctness of antiquotes Antiquotes should evaluate to strings or paths. This is usually checked, except in the case where the antiquote makes up the entire string, as in "${expr}". This is optimised to expr, which discards the runtime type checks / coercions. --- tests/lang/eval-fail-bad-antiquote-1.nix | 1 + tests/lang/eval-fail-bad-antiquote-2.nix | 1 + tests/lang/eval-fail-bad-antiquote-3.nix | 1 + 3 files changed, 3 insertions(+) create mode 100644 tests/lang/eval-fail-bad-antiquote-1.nix create mode 100644 tests/lang/eval-fail-bad-antiquote-2.nix create mode 100644 tests/lang/eval-fail-bad-antiquote-3.nix (limited to 'tests') diff --git a/tests/lang/eval-fail-bad-antiquote-1.nix b/tests/lang/eval-fail-bad-antiquote-1.nix new file mode 100644 index 000000000000..ffe9c983c26b --- /dev/null +++ b/tests/lang/eval-fail-bad-antiquote-1.nix @@ -0,0 +1 @@ +"${x: x}" diff --git a/tests/lang/eval-fail-bad-antiquote-2.nix b/tests/lang/eval-fail-bad-antiquote-2.nix new file mode 100644 index 000000000000..3745235ce95e --- /dev/null +++ b/tests/lang/eval-fail-bad-antiquote-2.nix @@ -0,0 +1 @@ +"${./fnord}" diff --git a/tests/lang/eval-fail-bad-antiquote-3.nix b/tests/lang/eval-fail-bad-antiquote-3.nix new file mode 100644 index 000000000000..65b9d4f505b1 --- /dev/null +++ b/tests/lang/eval-fail-bad-antiquote-3.nix @@ -0,0 +1 @@ +''${x: x}'' -- cgit 1.4.1