mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
Merge remote-tracking branch 'origin/master' into flakes
This commit is contained in:
commit
6fadb3fc03
20 changed files with 217 additions and 181 deletions
1
tests/lang/eval-okay-fromjson-escapes.exp
Normal file
1
tests/lang/eval-okay-fromjson-escapes.exp
Normal file
|
@ -0,0 +1 @@
|
|||
"quote \" reverse solidus \\ solidus / backspace formfeed newline \n carriage return \r horizontal tab \t 1 char unicode encoded backspace 1 char unicode encoded e with accent é 2 char unicode encoded s with caron š 3 char unicode encoded rightwards arrow →"
|
3
tests/lang/eval-okay-fromjson-escapes.nix
Normal file
3
tests/lang/eval-okay-fromjson-escapes.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
# This string contains all supported escapes in a JSON string, per json.org
|
||||
# \b and \f are not supported by Nix
|
||||
builtins.fromJSON ''"quote \" reverse solidus \\ solidus \/ backspace \b formfeed \f newline \n carriage return \r horizontal tab \t 1 char unicode encoded backspace \u0008 1 char unicode encoded e with accent \u00e9 2 char unicode encoded s with caron \u0161 3 char unicode encoded rightwards arrow \u2192"''
|
|
@ -16,6 +16,8 @@ mkDerivation {
|
|||
|
||||
__structuredAttrs = true;
|
||||
|
||||
outputs = [ "out" "dev" ];
|
||||
|
||||
buildCommand = ''
|
||||
set -x
|
||||
|
||||
|
@ -30,8 +32,9 @@ mkDerivation {
|
|||
[[ -v nothing ]]
|
||||
[[ -z $nothing ]]
|
||||
|
||||
mkdir ''${outputs[out]}
|
||||
mkdir ''${outputs[out]} ''${outputs[dev]}
|
||||
echo bar > $dest
|
||||
echo foo > $dest2
|
||||
|
||||
json=$(cat .attrs.json)
|
||||
[[ $json =~ '"narHash":"sha256:1r7yc43zqnzl5b0als5vnyp649gk17i37s7mj00xr8kc47rjcybk"' ]]
|
||||
|
@ -57,6 +60,7 @@ mkDerivation {
|
|||
nothing = null;
|
||||
|
||||
dest = "${placeholder "out"}/foo";
|
||||
dest2 = "${placeholder "dev"}/foo";
|
||||
|
||||
"foo bar" = "BAD";
|
||||
"1foobar" = "BAD";
|
||||
|
|
|
@ -2,6 +2,7 @@ source common.sh
|
|||
|
||||
clearStore
|
||||
|
||||
outPath=$(nix-build structured-attrs.nix --no-out-link)
|
||||
nix-build structured-attrs.nix -A all -o $TEST_ROOT/result
|
||||
|
||||
[[ $(cat $outPath/foo) = bar ]]
|
||||
[[ $(cat $TEST_ROOT/result/foo) = bar ]]
|
||||
[[ $(cat $TEST_ROOT/result-dev/foo) = foo ]]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue