Permalink
Browse files

Test for read -r.

  • Loading branch information...
Andy Chu
Andy Chu committed Sep 6, 2017
1 parent 4e3e9a7 commit 5949fe14ea9f20b7ed301dbf78f96b4b97fdd17e
Showing with 10 additions and 3 deletions.
  1. +2 −2 gold/nix.sh
  2. +7 −0 spec/builtins.test.sh
  3. +1 −1 test/spec.sh
View
@@ -1,7 +1,7 @@
#!/bin/bash
#
# Usage:
# ./nix.sh <function name>
# Copied from hard-coded-descriptors/ in oilshell/blog-code, which was copied
# from Nix setup.sh. See issue #26.
set -o nounset
set -o pipefail
View
@@ -210,6 +210,13 @@ argv.py $x $REPLY
# stdout: ['1234', '12']
# N-I dash stdout: []
### read -r ignores backslashes
echo 'one\ two' > $TMP/readr.txt
read escaped < $TMP/readr.txt
read -r raw < $TMP/readr.txt
argv "$escaped" "$raw"
# stdout: ['one two', 'one\\ two']
### get umask
umask | grep '[0-9]\+' # check for digits
# status: 0
View
@@ -253,7 +253,7 @@ test-builtin() {
}
builtins() {
sh-spec spec/builtins.test.sh --osh-failures-allowed 2 \
sh-spec spec/builtins.test.sh --osh-failures-allowed 3 \
${REF_SHELLS[@]} $OSH "$@"
}

0 comments on commit 5949fe1

Please sign in to comment.