diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-05-01 14:01:47 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-05-01 14:01:47 +0000 |
commit | 0064599a27ec44880e4ff6fa19f453e610b5ef07 (patch) | |
tree | 50289edc19dc99d5423ce8f57b99c5b8eb5597c1 /tests | |
parent | 6cecad2be0f7ced82658ec2a86bcf61583487959 (diff) | |
download | guix-0064599a27ec44880e4ff6fa19f453e610b5ef07.tar.gz |
* String interpolation. Expressions like
"--with-freetype2-library=" + freetype + "/lib" can now be written as "--with-freetype2-library=${freetype}/lib" An arbitrary expression can be enclosed within ${...}, not just identifiers. * Escaping in string literals: \n, \r, \t interpreted as in C, any other character following \ is interpreted as-is. * Newlines are now allowed in string literals.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lang/eval-okay-string.exp | 2 | ||||
-rw-r--r-- | tests/lang/eval-okay-string.nix | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/tests/lang/eval-okay-string.exp b/tests/lang/eval-okay-string.exp index 9c3f56c3f3..dd0e5e248d 100644 --- a/tests/lang/eval-okay-string.exp +++ b/tests/lang/eval-okay-string.exp @@ -1 +1 @@ -Str("foobar/a/b/c/d/foo/xyzzy/foo.txt/../foo/x/y") +Str("foobar/a/b/c/d/foo/xyzzy/foo.txt/../foo/x/yescape: \"quote\" \n \\end\nof\nlinefoobarblaat") diff --git a/tests/lang/eval-okay-string.nix b/tests/lang/eval-okay-string.nix index b5280a0cd1..f2452e8574 100644 --- a/tests/lang/eval-okay-string.nix +++ b/tests/lang/eval-okay-string.nix @@ -1 +1,9 @@ -"foo" + "bar" + toString (/a/b + /c/d) + (/foo/bar + "/../xyzzy/." + "/foo.txt") + ("/../foo" + /x/y) +"foo" + "bar" + + toString (/a/b + /c/d) + + (/foo/bar + "/../xyzzy/." + "/foo.txt") + + ("/../foo" + /x/y) + + "escape: \"quote\" \n \\" + + "end +of +line" + + "foo${if true then "b${"a" + "r"}" else "xyzzy"}blaat" |