aboutsummaryrefslogtreecommitdiff
path: root/tests/lang
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-17 00:45:16 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-17 00:51:07 +0200
commit9d8a80375d2d0581b53d270eb4d543fa0d3f0190 (patch)
treec289a41aeb0ce44b7b41938b8a7516325a5f1c9c /tests/lang
parentd6a7aa8f4827f97856ed55226426c355e1d1b4d1 (diff)
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.
Diffstat (limited to 'tests/lang')
-rw-r--r--tests/lang/eval-fail-bad-antiquote-1.nix1
-rw-r--r--tests/lang/eval-fail-bad-antiquote-2.nix1
-rw-r--r--tests/lang/eval-fail-bad-antiquote-3.nix1
3 files changed, 3 insertions, 0 deletions
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 000000000..ffe9c983c
--- /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 000000000..3745235ce
--- /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 000000000..65b9d4f50
--- /dev/null
+++ b/tests/lang/eval-fail-bad-antiquote-3.nix
@@ -0,0 +1 @@
+''${x: x}''