mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 14:06:16 +02:00
add flakes.sh test for shebang supported types of comments
This commit is contained in:
parent
a2c3333b97
commit
6227cd06bd
1 changed files with 18 additions and 0 deletions
|
@ -93,6 +93,23 @@ foo
|
||||||
EOF
|
EOF
|
||||||
chmod +x $nonFlakeDir/shebang-comments.sh
|
chmod +x $nonFlakeDir/shebang-comments.sh
|
||||||
|
|
||||||
|
cat > $nonFlakeDir/shebang-different-comments.sh <<EOF
|
||||||
|
#! $(type -P env) nix
|
||||||
|
# some comments
|
||||||
|
// some comments
|
||||||
|
* some comments
|
||||||
|
\ some comments
|
||||||
|
% some comments
|
||||||
|
@ some comments
|
||||||
|
-- some comments
|
||||||
|
(* some comment
|
||||||
|
#! nix --offline shell
|
||||||
|
#! nix flake1#fooScript
|
||||||
|
#! nix --no-write-lock-file --command cat
|
||||||
|
foo
|
||||||
|
EOF
|
||||||
|
chmod +x $nonFlakeDir/shebang-different-comments.sh
|
||||||
|
|
||||||
cat > $nonFlakeDir/shebang-reject.sh <<EOF
|
cat > $nonFlakeDir/shebang-reject.sh <<EOF
|
||||||
#! $(type -P env) nix
|
#! $(type -P env) nix
|
||||||
# some comments
|
# some comments
|
||||||
|
@ -607,6 +624,7 @@ expectStderr 1 nix flake metadata "$flake2Dir" --no-allow-dirty --reference-lock
|
||||||
[[ $($nonFlakeDir/shebang.sh) = "foo" ]]
|
[[ $($nonFlakeDir/shebang.sh) = "foo" ]]
|
||||||
[[ $($nonFlakeDir/shebang.sh "bar") = "foo"$'\n'"bar" ]]
|
[[ $($nonFlakeDir/shebang.sh "bar") = "foo"$'\n'"bar" ]]
|
||||||
[[ $($nonFlakeDir/shebang-comments.sh ) = "foo" ]]
|
[[ $($nonFlakeDir/shebang-comments.sh ) = "foo" ]]
|
||||||
|
[[ "$($nonFlakeDir/shebang-different-comments.sh)" = "$(cat $nonFlakeDir/shebang-different-comments.sh)" ]]
|
||||||
[[ $($nonFlakeDir/shebang-inline-expr.sh baz) = "foo"$'\n'"baz" ]]
|
[[ $($nonFlakeDir/shebang-inline-expr.sh baz) = "foo"$'\n'"baz" ]]
|
||||||
[[ $($nonFlakeDir/shebang-file.sh baz) = "foo"$'\n'"baz" ]]
|
[[ $($nonFlakeDir/shebang-file.sh baz) = "foo"$'\n'"baz" ]]
|
||||||
expect 1 $nonFlakeDir/shebang-reject.sh 2>&1 | grepQuiet -F 'error: unsupported unquoted character in nix shebang: *. Use double backticks to escape?'
|
expect 1 $nonFlakeDir/shebang-reject.sh 2>&1 | grepQuiet -F 'error: unsupported unquoted character in nix shebang: *. Use double backticks to escape?'
|
||||||
|
|
Loading…
Reference in a new issue