Results for builtin-read.test.sh

statusbashdashashzshmkshkshtoyshsushbrushosh
pass 4115371728290193144
ok 3201300000
N-I 025816600000
BUG 2318900000
FAIL 01000174627152
TIME 0004000000
total46464646464646464646
casebashdashashzshmkshkshtoyshsushbrushoshdescription
0pass pass pass pass pass pass FAIL pass pass pass read line from here doc
details
1pass ok pass pass pass pass FAIL pass pass pass read from empty file
detailsdetails
2pass ok pass pass pass pass FAIL pass pass pass read /dev/null
detailsdetails
3pass BUG pass pass pass pass FAIL pass pass pass read with zero args
detailsdetails
4pass pass pass pass pass pass FAIL FAIL FAIL pass read builtin with no newline returns status 1
detailsdetailsdetails
5pass pass pass pass pass pass FAIL pass pass pass read builtin splits value across multiple vars
details
6pass pass pass pass pass pass FAIL pass pass pass read builtin with too few variables
details
7pass N-I pass N-I pass pass FAIL pass pass pass read -n (with $REPLY)
detailsdetailsdetails
8pass N-I pass N-I pass pass FAIL pass pass pass IFS= read -n (OSH regression: value saved in tempenv)
detailsdetailsdetails
9pass N-I pass N-I BUG FAIL FAIL FAIL pass pass read -n doesn't strip whitespace (bug fix)
detailsdetailsdetailsdetailsdetailsdetails
10pass N-I N-I N-I BUG FAIL FAIL FAIL pass pass read -d -n - respects delimiter and splits
detailsdetailsdetailsdetailsdetailsdetailsdetails
11ok pass pass N-I pass pass FAIL FAIL pass pass read -n with invalid arg
detailsdetailsdetailsdetails
12pass N-I N-I N-I pass pass FAIL pass pass pass read -n from pipe
detailsdetailsdetailsdetails
13pass FAIL pass BUG BUG FAIL FAIL FAIL FAIL pass read without args uses $REPLY, no splitting occurs (without -n)
detailsdetailsdetailsdetailsdetailsdetailsdetails
14pass N-I N-I N-I BUG FAIL FAIL FAIL FAIL pass read -n vs. -N
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
15pass N-I N-I N-I pass pass FAIL FAIL pass pass read -N ignores delimiters
detailsdetailsdetailsdetailsdetails
16pass N-I pass BUG pass pass FAIL FAIL pass pass read will unset extranous vars
detailsdetailsdetailsdetails
17pass pass pass pass pass pass FAIL pass FAIL pass read -r ignores backslashes
detailsdetails
18pass pass pass BUG BUG FAIL FAIL FAIL FAIL pass read -r with other backslash escapes
detailsdetailsdetailsdetailsdetailsdetails
19pass N-I pass pass pass pass FAIL pass FAIL pass read with line continuation reads multiple physical lines
detailsdetailsdetails
20pass pass pass pass pass pass FAIL pass FAIL pass read multiple vars spanning many lines
detailsdetails
21pass BUG pass BUG BUG FAIL FAIL pass FAIL pass read -r with \n
detailsdetailsdetailsdetailsdetailsdetails
22pass N-I pass N-I pass pass FAIL FAIL pass pass read -s from pipe, not a terminal
detailsdetailsdetailsdetails
23pass N-I pass pass pass pass FAIL FAIL pass pass read with IFS=$'\n'
detailsdetailsdetails
24pass pass pass pass pass pass FAIL FAIL FAIL pass read multiple lines with IFS=:
detailsdetailsdetails
25pass pass pass pass pass pass FAIL FAIL pass pass read with IFS=''
detailsdetails
26pass BUG BUG BUG BUG FAIL FAIL FAIL FAIL pass read does not respect C backslash escapes
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
27pass pass pass pass pass pass FAIL pass pass pass dynamic scope used to set vars
details
28pass N-I N-I N-I N-I FAIL FAIL pass FAIL pass read -a reads into array
detailsdetailsdetailsdetailsdetailsdetailsdetails
29pass N-I pass TIME pass pass FAIL pass pass pass read -d : (colon-separated records)
detailsdetailsdetails
30pass N-I pass TIME pass pass FAIL FAIL pass pass read -d '' (null-separated records)
detailsdetailsdetailsdetails
31pass N-I pass TIME pass pass FAIL FAIL pass pass read -rd
detailsdetailsdetailsdetails
32pass N-I pass TIME pass pass FAIL FAIL FAIL pass read -d when there's no delimiter
detailsdetailsdetailsdetailsdetails
33pass N-I pass N-I N-I FAIL FAIL FAIL FAIL pass read -t 0 tests if input is available
detailsdetailsdetailsdetailsdetailsdetailsdetails
34pass N-I pass BUG BUG pass FAIL pass FAIL FAIL read -t 0.5
detailsdetailsdetailsdetailsdetailsdetails
35BUG pass pass BUG pass pass FAIL FAIL pass pass read -t -0.5 is invalid
detailsdetailsdetailsdetails
36pass N-I pass pass N-I FAIL FAIL FAIL pass FAIL read -u
detailsdetailsdetailsdetailsdetailsdetails
37ok pass pass ok pass pass FAIL FAIL pass pass read -u syntax error
detailsdetailsdetailsdetails
38pass N-I N-I N-I ok FAIL FAIL FAIL pass pass read -N doesn't respect delimiter, while read -n does
detailsdetailsdetailsdetailsdetailsdetailsdetails
39pass N-I pass N-I N-I FAIL FAIL FAIL FAIL pass read -p (not fully tested)
detailsdetailsdetailsdetailsdetailsdetailsdetails
40ok pass pass BUG BUG FAIL FAIL FAIL pass pass read usage
detailsdetailsdetailsdetailsdetailsdetails
41pass N-I pass N-I pass pass FAIL FAIL pass pass read with smooshed args
detailsdetailsdetailsdetails
42pass N-I pass N-I N-I FAIL FAIL FAIL pass pass read -r -d '' for NUL strings, e.g. find -print0
detailsdetailsdetailsdetailsdetailsdetails
43pass pass pass pass ok FAIL FAIL pass pass pass read from redirected directory is non-fatal error
detailsdetailsdetails
44pass N-I N-I pass ok FAIL FAIL pass pass pass read -n from directory
detailsdetailsdetailsdetailsdetails
45BUG N-I N-I N-I N-I FAIL FAIL FAIL pass pass mapfile from directory (bash doesn't handle errors)
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
261 passed, 9 OK, 55 not implemented, 23 BUG, 108 failed, 4 timeouts, 0 cases skipped
2 failed under osh

Details on runs that didn't PASS

toysh0 read line from here doc

[toysh stdout] Expected '[A\t\tB C D E]\n', got '[]\n'

stdout:
[]
stderr:
sh: read: No such file or directory
dash1 read from empty file

stdout:
['status=1', '']
['status=2', '']
stderr:
dash: 5: read: arg count
toysh1 read from empty file

[toysh stdout] Expected "['status=1', '']\n['status=1', '']\n", got "['status=127', '']\n['status=127', '']\n"

stdout:
['status=127', '']
['status=127', '']
stderr:
sh: read: No such file or directory
sh: read: No such file or directory
dash2 read /dev/null

stdout:
2
stderr:
dash: 1: read: Illegal option -n
toysh2 read /dev/null

[toysh stdout] Expected '1\n', got '127\n'

stdout:
127
stderr:
sh: read: No such file or directory
dash3 read with zero args

stdout:
status=2
stderr:
dash: 1: read: arg count
toysh3 read with zero args

[toysh stdout] Expected 'status=0\n', got 'status=127\n'

stdout:
status=127
stderr:
sh: read: No such file or directory
toysh4 read builtin with no newline returns status 1

[toysh stdout] Expected 'status=1\nZZZ\n', got 'status=127\n\n'
[toysh status] Expected 0, got 127

stdout:
status=127

stderr:
sh: read: No such file or directory
sh: ZZZ: No such file or directory
sush4 read builtin with no newline returns status 1

[sush stdout] Expected 'status=1\nZZZ\n', got 'status=0\nZZZ\n'

stdout:
status=0
ZZZ
stderr:
brush4 read builtin with no newline returns status 1

[brush stdout] Expected 'status=1\nZZZ\n', got 'status=0\nZZZ\n'

stdout:
status=0
ZZZ
stderr:
toysh5 read builtin splits value across multiple vars

[toysh stdout] Expected '[A/B/C D E]\n', got '[//]\n'

stdout:
[//]
stderr:
sh: read: No such file or directory
toysh6 read builtin with too few variables

[toysh stdout] Expected '/A/B//\n', got '////\n'

stdout:
////
stderr:
set: bad -o errexit
set: bad -o nounset
sh: read: No such file or directory
dash7 read -n (with $REPLY)

stdout:
[]
stderr:
dash: 2: read: Illegal option -n
dash: 3: read: Illegal option -n
zsh7 read -n (with $REPLY)

stdout:
[]
stderr:
toysh7 read -n (with $REPLY)

[toysh stdout] Expected "['1234', '12']\n", got '[]\n'

stdout:
[]
stderr:
sh: read: No such file or directory
sh: read: No such file or directory
dash8 IFS= read -n (OSH regression: value saved in tempenv)

stdout:
['']
stderr:
dash: 2: read: Illegal option -n
zsh8 IFS= read -n (OSH regression: value saved in tempenv)

stdout:
['']
stderr:
toysh8 IFS= read -n (OSH regression: value saved in tempenv)

[toysh stdout] Expected "['X']\n", got "['']\n"

stdout:
['']
stderr:
sh: read: No such file or directory
dash9 read -n doesn't strip whitespace (bug fix)

stdout:
stderr: 
zsh9 read -n doesn't strip whitespace (bug fix)

stdout:
stderr: 
mksh9 read -n doesn't strip whitespace (bug fix)

stdout:
[a]
[a b]
[a b]

one var strips whitespace
[a]
[a b]
[a b]

three vars
[a] [] []
[a] [b] []
[a] [b] []
stderr:
ksh9 read -n doesn't strip whitespace (bug fix)

[ksh stdout] Expected '[ a ]\n[ a b]\n[ a b ]\n\none var strips whitespace\n[a]\n[a b]\n[a b]\n\nthree vars\n[a] [] []\n[a] [b] []\n[a] [b] []\n' Got '[a]\n[a b]\n[a b]\n\none var strips whitespace\n[a]\n[a b]\n[a b]\n\nthree vars\n[a] [] []\n[a] [b] []\n[a] [b] []\n'

stdout:
[a]
[a b]
[a b]

one var strips whitespace
[a]
[a b]
[a b]

three vars
[a] [] []
[a] [b] []
[a] [b] []
stderr:
toysh9 read -n doesn't strip whitespace (bug fix)

[toysh stdout] Expected '[ a ]\n[ a b]\n[ a b ]\n\none var strips whitespace\n[a]\n[a b]\n[a b]\n\nthree vars\n[a] [] []\n[a] [b] []\n[a] [b] []\n' Got ''
[toysh status] Expected 0, got -6

stdout:
stderr: 
munmap_chunk(): invalid pointer
sush9 read -n doesn't strip whitespace (bug fix)

[sush stdout] Expected '[ a ]\n[ a b]\n[ a b ]\n\none var strips whitespace\n[a]\n[a b]\n[a b]\n\nthree vars\n[a] [] []\n[a] [b] []\n[a] [b] []\n' Got '[a b]\n[a b]\n[a b]\n\none var strips whitespace\n[a b]\n[a b]\n[a b]\n\nthree vars\n[a] [] []\n[a] [b] []\n[a] [b] []\n'

stdout:
[a b]
[a b]
[a b]

one var strips whitespace
[a b]
[a b]
[a b]

three vars
[a] [] []
[a] [b] []
[a] [b] []
stderr:
dash10 read -d -n - respects delimiter and splits

stdout:
stderr: 
ash10 read -d -n - respects delimiter and splits

stdout:
stderr: 
zsh10 read -d -n - respects delimiter and splits

stdout:
stderr: 
mksh10 read -d -n - respects delimiter and splits

stdout:
delim c
[a]
[a]
[a b]

one var
[a]
[a]
[a b]

three vars
[a] [] []
[a] [] []
[a] [b] []
stderr:
ksh10 read -d -n - respects delimiter and splits

[ksh stdout] Expected 'delim c\n[ a]\n[ a ]\n[ a b]\n\none var\n[a]\n[a]\n[a b]\n\nthree vars\n[a] [] []\n[a] [] []\n[a] [b] []\n' Got 'delim c\n[a]\n[a]\n[a b]\n\none var\n[a]\n[a]\n[a b]\n\nthree vars\n[a] [] []\n[a] [] []\n[a] [b] []\n'

stdout:
delim c
[a]
[a]
[a b]

one var
[a]
[a]
[a b]

three vars
[a] [] []
[a] [] []
[a] [b] []
stderr:
toysh10 read -d -n - respects delimiter and splits

[toysh stdout] Expected 'delim c\n[ a]\n[ a ]\n[ a b]\n\none var\n[a]\n[a]\n[a b]\n\nthree vars\n[a] [] []\n[a] [] []\n[a] [b] []\n' Got ''
[toysh status] Expected 0, got -6

stdout:
stderr: 
munmap_chunk(): invalid pointer
sush10 read -d -n - respects delimiter and splits

[sush stdout] Expected 'delim c\n[ a]\n[ a ]\n[ a b]\n\none var\n[a]\n[a]\n[a b]\n\nthree vars\n[a] [] []\n[a] [] []\n[a] [b] []\n' Got 'delim c\n[a]\n[a b]\n[a b]\n\none var\n[a]\n[a b]\n[a b]\n\nthree vars\n[a] [] []\n[a] [] []\n[a] [b] []\n'

stdout:
delim c
[a]
[a b]
[a b]

one var
[a]
[a b]
[a b]

three vars
[a] [] []
[a] [] []
[a] [b] []
stderr:
bash11 read -n with invalid arg

stdout:
status=1
stderr:
bash: line 1: read: not_a_number: invalid number
zsh11 read -n with invalid arg

stdout:
stderr: 
toysh11 read -n with invalid arg

[toysh stdout] Expected 'status=2\n', got 'status=127\n'

stdout:
status=127
stderr:
sh: read: No such file or directory
sush11 read -n with invalid arg

[sush stdout] Expected 'status=2\n', got 'status=1\n'

stdout:
status=1
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: read: not_a_number: invalid number
dash12 read -n from pipe

stdout:
stderr: 
ash12 read -n from pipe

stdout:
stderr: 
zsh12 read -n from pipe

stdout:
stderr: 
toysh12 read -n from pipe

[toysh stdout] Expected 'reply=abc\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: (
dash13 read without args uses $REPLY, no splitting occurs (without -n)

[dash stdout] Expected '[]\n[a b ]\n[]\n[a b line2]\n[]\n[a b \\]\n' Got '[]\n[a b]\n[]\n[a b line2]\n[]\n[a b \\]\n'

stdout:
[]
[a b]
[]
[a b    line2]
[]
[a b  \]
stderr:
dash: 1: read: arg count
dash: 5: read: arg count
dash: 10: read: arg count
zsh13 read without args uses $REPLY, no splitting occurs (without -n)

stdout:
[a b]
[a b]
[a b    line2]
[a b    line2]
[a b  \]
[a b  \]
stderr:
mksh13 read without args uses $REPLY, no splitting occurs (without -n)

stdout:
[a b]
[a b]
[a b    line2]
[a b    line2]
[a b  \]
[a b  \]
stderr:
ksh13 read without args uses $REPLY, no splitting occurs (without -n)

[ksh stdout] Expected '[ a b ]\n[a b]\n[ a b line2]\n[a b line2]\n[ a b \\]\n[a b \\]\n' Got '[a b]\n[a b]\n[a b line2]\n[a b line2]\n[a b \\]\n[a b \\]\n'

stdout:
[a b]
[a b]
[a b    line2]
[a b    line2]
[a b  \]
[a b  \]
stderr:
toysh13 read without args uses $REPLY, no splitting occurs (without -n)

[toysh stdout] Expected '[ a b ]\n[a b]\n[ a b line2]\n[a b line2]\n[ a b \\]\n[a b \\]\n' Got '[]\n[]\n[]\n[]\n[]\n[]\n'
[toysh status] Expected 0, got 127

stdout:
[]
[]
[]
[]
[]
[]
stderr:
sh: read: No such file or directory
sh: read: No such file or directory
sh: read: No such file or directory
sh: read: No such file or directory
sh: read: No such file or directory
sh: read: No such file or directory
sh: a: No such file or directory
sush13 read without args uses $REPLY, no splitting occurs (without -n)

[sush stdout] Expected '[ a b ]\n[a b]\n[ a b line2]\n[a b line2]\n[ a b \\]\n[a b \\]\n' Got '[a b]\n[a b]\n[a b \\]\n[a b \\]\n[a b \\]\n[a b \\]\n'

stdout:
[a b]
[a b]
[a b  \]
[a b  \]
[a b  \]
[a b  \]
stderr:
brush13 read without args uses $REPLY, no splitting occurs (without -n)

[brush stdout] Expected '[ a b ]\n[a b]\n[ a b line2]\n[a b line2]\n[ a b \\]\n[a b \\]\n' Got '[ a b ]\n[a b]\n[ a b \\]\n[a b \\]\n[ a b \\]\n[a b \\]\n'

stdout:
[  a b  ]
[a b]
[  a b  \]
[a b  \]
[  a b  \]
[a b  \]
stderr:
dash14 read -n vs. -N

stdout:
stderr: 
ash14 read -n vs. -N

stdout:
stderr: 
zsh14 read -n vs. -N

stdout:
stderr: 
mksh14 read -n vs. -N

stdout:
read -n
'a' 'b' 'c'
'a' 'b' ''

read -N
'a' 'b' 'c'
'a' 'b' ''
stderr:
ksh14 read -n vs. -N

[ksh stdout] Expected "read -n\n'a' 'b' 'c'\n'a' 'b' ''\n\nread -N\n'a b c' '' ''\n'a b ' '' ''\n" Got "read -n\n'a' 'b' 'c'\n'a' 'b' ''\n\nread -N\n'a' 'b' 'c'\n'a' 'b' ''\n"

stdout:
read -n
'a' 'b' 'c'
'a' 'b' ''

read -N
'a' 'b' 'c'
'a' 'b' ''
stderr:
toysh14 read -n vs. -N

[toysh stdout] Expected "read -n\n'a' 'b' 'c'\n'a' 'b' ''\n\nread -N\n'a b c' '' ''\n'a b ' '' ''\n" Got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: (
sush14 read -n vs. -N

[sush stdout] Expected "read -n\n'a' 'b' 'c'\n'a' 'b' ''\n\nread -N\n'a b c' '' ''\n'a b ' '' ''\n" Got "read -n\n'a' 'b' 'c'\n'a' 'b' 'c'\n\nread -N\n'a' 'b' 'c'\n'a' 'b' 'c'\n"

stdout:
read -n
'a' 'b' 'c'
'a' 'b' 'c'

read -N
'a' 'b' 'c'
'a' 'b' 'c'
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 12: `-N': invalid name
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 13: `-N': invalid name
brush14 read -n vs. -N

[brush stdout] Expected "read -n\n'a' 'b' 'c'\n'a' 'b' ''\n\nread -N\n'a b c' '' ''\n'a b ' '' ''\n" Got "read -n\n'a' 'b' 'c'\n'a' 'b' ''\n\nread -N\n'a' 'b' 'c'\n'a' 'b' ''\n"

stdout:
read -n
'a' 'b' 'c'
'a' 'b' ''

read -N
'a' 'b' 'c'
'a' 'b' ''
stderr:
dash15 read -N ignores delimiters

stdout:
stderr: 
ash15 read -N ignores delimiters

stdout:
stderr: 
zsh15 read -N ignores delimiters

stdout:
stderr: 
toysh15 read -N ignores delimiters

[toysh stdout] Expected 'a\nb\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: (
sush15 read -N ignores delimiters

[sush stdout] Expected 'a\nb\n', got '\n'

stdout:
stderr: 
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 5: `-N': invalid name
dash16 read will unset extranous vars

stdout:
'a' 'b' ''
stderr:
zsh16 read will unset extranous vars

stdout:
'a' 'b' ''
'b' '' ''
stderr:
toysh16 read will unset extranous vars

[toysh stdout] Expected "'a' 'b' ''\n'a' 'b' ''\n", got "'' '' 'some value'\n"
[toysh status] Expected 0, got 2

stdout:
'' '' 'some value'
stderr:
sh: read: No such file or directory
main: line 7: sh: syntax error: (
sush16 read will unset extranous vars

[sush stdout] Expected "'a' 'b' ''\n'a' 'b' ''\n", got "'a' 'b' 'some value'\n'a' 'b' 'some value'\n"

stdout:
'a' 'b' 'some value'
'a' 'b' 'some value'
stderr:
toysh17 read -r ignores backslashes

[toysh stdout] Expected "['one two', 'one\\\\ two']\n", got "['', '']\n"

stdout:
['', '']
stderr:
sh: read: No such file or directory
sh: read: No such file or directory
brush17 read -r ignores backslashes

[brush stdout] Expected "['one two', 'one\\\\ two']\n", got "['one\\\\ two', 'one\\\\ two']\n"

stdout:
['one\\ two', 'one\\ two']
stderr:
zsh18 read -r with other backslash escapes

stdout:
['one twoethree', 'one\\ twoethree']
stderr:
mksh18 read -r with other backslash escapes

stdout:
['one twoethree', 'one\\ twoethree']
stderr:
ksh18 read -r with other backslash escapes

[ksh stdout] Expected "['one twox65three', 'one\\\\ two\\\\x65three']\n" Got "['one twoethree', 'one\\\\ twoethree']\n"

stdout:
['one twoethree', 'one\\ twoethree']
stderr:
toysh18 read -r with other backslash escapes

[toysh stdout] Expected "['one twox65three', 'one\\\\ two\\\\x65three']\n" Got "['', '']\n"

stdout:
['', '']
stderr:
sh: read: No such file or directory
sh: read: No such file or directory
sush18 read -r with other backslash escapes

[sush stdout] Expected "['one twox65three', 'one\\\\ two\\\\x65three']\n" Got "['one two\\\\65three', 'one\\\\ two\\\\x65three']\n"

stdout:
['one two\\65three', 'one\\ two\\x65three']
stderr:
brush18 read -r with other backslash escapes

[brush stdout] Expected "['one twox65three', 'one\\\\ two\\\\x65three']\n" Got "['one\\\\ two\\\\x65three', 'one\\\\ two\\\\x65three']\n"

stdout:
['one\\ two\\x65three', 'one\\ two\\x65three']
stderr:
dash19 read with line continuation reads multiple physical lines

stdout:
['-e onetwo', '-e one\\']
stderr:
toysh19 read with line continuation reads multiple physical lines

[toysh stdout] Expected "['onetwo', 'one\\\\']\n", got "['', '']\n"

stdout:
['', '']
stderr:
sh: read: No such file or directory
sh: read: No such file or directory
brush19 read with line continuation reads multiple physical lines

[brush stdout] Expected "['onetwo', 'one\\\\']\n", got "['one\\\\', 'one\\\\']\n"

stdout:
['one\\', 'one\\']
stderr:
toysh20 read multiple vars spanning many lines

[toysh stdout] Expected "['one-two', 'three-four five-six', '']\n", got "['', '', '']\n"

stdout:
['', '', '']
stderr:
sh: read: No such file or directory
brush20 read multiple vars spanning many lines

[brush stdout] Expected "['one-two', 'three-four five-six', '']\n", got "['one-\\\\', '', '']\n"

stdout:
['one-\\', '', '']
stderr:
dash21 read -r with \n

stdout:
['', '']
stderr:
zsh21 read -r with \n

stdout:
['', '']
stderr:
mksh21 read -r with \n

stdout:
['', '']
stderr:
ksh21 read -r with \n

[ksh stdout] Expected "['nline', '\\\\nline']\n", got "['', '']\n"

stdout:
['', '']
stderr:
toysh21 read -r with \n

[toysh stdout] Expected "['nline', '\\\\nline']\n", got "['', '']\n"

stdout:
['', '']
stderr:
sh: read: No such file or directory
sh: read: No such file or directory
brush21 read -r with \n

[brush stdout] Expected "['nline', '\\\\nline']\n", got "['\\\\nline', '\\\\nline']\n"

stdout:
['\\nline', '\\nline']
stderr:
dash22 read -s from pipe, not a terminal

stdout:
stderr: 
zsh22 read -s from pipe, not a terminal

stdout:
stderr: 
toysh22 read -s from pipe, not a terminal

[toysh stdout] Expected 'foo\nba\n0\nb\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: (
sush22 read -s from pipe, not a terminal

[sush stdout] Expected 'foo\nba\n0\nb\n', got '\n\n1\n\n'

stdout:

1

stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: `-s': invalid name
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 5: `-s': invalid name
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 7: `-s': invalid name
dash23 read with IFS=$'\n'

stdout:
[a b c]
stderr:
toysh23 read with IFS=$'\n'

[toysh stdout] Expected '[ a b c]\n', got '[]\n'

stdout:
[]
stderr:
sh: read: No such file or directory
sush23 read with IFS=$'\n'

[sush stdout] Expected '[ a b c]\n', got '[a b c]\n'

stdout:
[a b c]
stderr:
toysh24 read multiple lines with IFS=:

[toysh stdout] Expected '[ \\a |b: c|d e|]\n', got '[|||]\n'

stdout:
[|||]
stderr:
sh: read: No such file or directory
sush24 read multiple lines with IFS=:

[sush stdout] Expected '[ \\a |b: c|d e|]\n', got '[\\a |b: c|d e|]\n'

stdout:
[\a |b: c|d  e|]
stderr:
brush24 read multiple lines with IFS=:

[brush stdout] Expected '[ \\a |b: c|d e|]\n', got '[ \\\\a |b\\| c|d\\]\n'

stdout:
[  \\a |b\| c|d\]
stderr:
toysh25 read with IFS=''

[toysh stdout] Expected '[ a b c d|]\n', got '[|]\n'

stdout:
[|]
stderr:
sh: read: No such file or directory
sush25 read with IFS=''

[sush stdout] Expected '[ a b c d|]\n', got '[a b c d|]\n'

stdout:
[a b c d|]
stderr:
dash26 read does not respect C backslash escapes

stdout:
 
stderr:
ash26 read does not respect C backslash escapes

stdout:
abcdefghx65 145 i
stderr:
zsh26 read does not respect C backslash escapes

stdout:
 
stderr:
mksh26 read does not respect C backslash escapes

stdout:
  d   g h e 145 i
stderr:
ksh26 read does not respect C backslash escapes

[ksh stdout] Expected 'a b c d e f g h x65 145 i\n', got '\x07 \x08 d \x1b \x0c g h e 145 i\n'

stdout:
  d   g h e 145 i
stderr:
toysh26 read does not respect C backslash escapes

[toysh stdout] Expected 'a b c d e f g h x65 145 i\n', got '\n'

stdout:
stderr: 
sh: read: No such file or directory
sush26 read does not respect C backslash escapes

[sush stdout] Expected 'a b c d e f g h x65 145 i\n', got 'a \\b \\c \\d \\e \\f \\g \\h \\x65 \\145 \\i\n'

stdout:
a \b \c \d \e \f \g \h \x65 \145 \i
stderr:
brush26 read does not respect C backslash escapes

[brush stdout] Expected 'a b c d e f g h x65 145 i\n', got '\\a \\b \\c \\d \\e \\f \\g \\h \\x65 \\145 \\i\n'

stdout:
\a \b \c \d \e \f \g \h \x65 \145 \i
stderr:
toysh27 dynamic scope used to set vars

[toysh stdout] Expected 'ref: refs/heads/dev/andy\n', got '\n'

stdout:
stderr: 
sh: read: No such file or directory
dash28 read -a reads into array

stdout:
stderr: 
ash28 read -a reads into array

stdout:
stderr: 
ash: read: line 7: illegal option -a
ash: syntax error: bad substitution
zsh28 read -a reads into array

stdout:
stderr: 
mksh28 read -a reads into array

stdout:
stderr: 
ksh28 read -a reads into array

[ksh stdout] Expected "['a', 'b', 'c d']\n['a', 'b', 'c\\\\', 'd']\n[]\n[]\n" Got "['97', '32', '98', '32', '99', '92', '32', '100']\n[]\n[]\n[]\n"

stdout:
['97', '32', '98', '32', '99', '92', '32', '100']
[]
[]
[]
stderr:
E: ksh: <stdin>[14]: read: too many arguments
toysh28 read -a reads into array

[toysh stdout] Expected "['a', 'b', 'c d']\n['a', 'b', 'c\\\\', 'd']\n[]\n[]\n" Got ''
[toysh status] Expected 0, got -6

stdout:
stderr: 
munmap_chunk(): invalid pointer
brush28 read -a reads into array

[brush stdout] Expected "['a', 'b', 'c d']\n['a', 'b', 'c\\\\', 'd']\n[]\n[]\n" Got "['a', 'b', 'c\\\\', 'd']\n['a', 'b', 'c\\\\', 'd']\n[]\n[]\n"

stdout:
['a', 'b', 'c\\', 'd']
['a', 'b', 'c\\', 'd']
[]
[]
stderr:
dash29 read -d : (colon-separated records)

stdout:
v1=
v1= v2=
v1= v2= v3=
stderr:
dash: 3: read: Illegal option -d
dash: 5: read: Illegal option -d
dash: 7: read: Illegal option -d
toysh29 read -d : (colon-separated records)

[toysh stdout] Expected 'v1=a,b,c\nv1=d v2=e,f\nv1=g v2=h v3=i\n', got 'v1=\nv1= v2=\nv1= v2= v3=\n'
[toysh status] Expected 0, got 127

stdout:
v1=
v1= v2=
v1= v2= v3=
stderr:
sh: read: No such file or directory
sh: read: No such file or directory
sh: read: No such file or directory
sh: a,b,c:d,e,f:g,h,i: No such file or directory
dash30 read -d '' (null-separated records)

stdout:
v1=
v1= v2=
v1= v2= v3=
stderr:
dash: 3: read: Illegal option -d
dash: 5: read: Illegal option -d
dash: 7: read: Illegal option -d
toysh30 read -d '' (null-separated records)

[toysh stdout] Expected 'v1=a,b,c\nv1=d v2=e,f\nv1=g v2=h v3=i\n', got 'v1=\nv1= v2=\nv1= v2= v3=\n'
[toysh status] Expected 0, got 127

stdout:
v1=
v1= v2=
v1= v2= v3=
stderr:
sh: read: No such file or directory
sh: read: No such file or directory
sh: read: No such file or directory
sh: a,b,cd,e,fg,h,i: No such file or directory
sush30 read -d '' (null-separated records)

[sush stdout] Expected 'v1=a,b,c\nv1=d v2=e,f\nv1=g v2=h v3=i\n', got 'v1=a,b,c\\0d,e,f\\0g,h,i\nv1=a,b,c\\0d,e,f\\0g,h,i v2=\nv1=a,b,c\\0d,e,f\\0g,h,i v2= v3=\n'

stdout:
v1=a,b,c\0d,e,f\0g,h,i
v1=a,b,c\0d,e,f\0g,h,i v2=
v1=a,b,c\0d,e,f\0g,h,i v2= v3=
stderr:
dash31 read -rd

stdout:
stderr: 
dash: 1: read: Illegal option -d
toysh31 read -rd

[toysh stdout] Expected 'foo\nbar\n', got '\n'

stdout:
stderr: 
sh: read: No such file or directory
sush31 read -rd

[sush stdout] Expected 'foo\nbar\n', got 'foo\n'

stdout:
foo
stderr:
dash32 read -d when there's no delimiter

stdout:
2
2
stderr:
dash: 1: read: Illegal option -d
dash: 3: read: Illegal option -d
toysh32 read -d when there's no delimiter

[toysh stdout] Expected 'foo 0\nbar 1\n', got '127\n127\n'
[toysh status] Expected 0, got 127

stdout:
127
127
stderr:
sh: read: No such file or directory
sh: read: No such file or directory
sh: foo:bar: No such file or directory
sush32 read -d when there's no delimiter

[sush stdout] Expected 'foo 0\nbar 1\n', got 'foo 0\nbar 0\n'

stdout:
foo 0
bar 0
stderr:
brush32 read -d when there's no delimiter

[brush stdout] Expected 'foo 0\nbar 1\n', got 'foo 0\nbar 0\n'

stdout:
foo 0
bar 0
stderr:
dash33 read -t 0 tests if input is available

stdout:
stderr: 
zsh33 read -t 0 tests if input is available

stdout:
stderr: 
mksh33 read -t 0 tests if input is available

stdout:
stderr: 
ksh33 read -t 0 tests if input is available

[ksh stdout] Expected '0\n0\nreply=\n0\n', got '1\n1\nreply=\n0\n'

stdout:
1
1
reply=
0
stderr:
toysh33 read -t 0 tests if input is available

[toysh stdout] Expected '0\n0\nreply=\n0\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: (
sush33 read -t 0 tests if input is available

[sush stdout] Expected '0\n0\nreply=\n0\n', got '1\n1\nreply=\n0\n'

stdout:
1
1
reply=
0
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 9: `-t': invalid name
brush33 read -t 0 tests if input is available

[brush stdout] Expected '0\n0\nreply=\n0\n', got '1\n2\nreply=\n0\n'

stdout:
1
2
reply=
0
stderr:
 WARN not yet implemented: read -t; see https://github.com/reubeno/brush/issues/227
error: invalid value '0.0' for '-t <SECONDS>': invalid digit found in string

For more information, try '--help'.

 WARN not yet implemented: read -t; see https://github.com/reubeno/brush/issues/227
dash34 read -t 0.5

stdout:
stderr: 
zsh34 read -t 0.5

stdout:
1
stderr:
mksh34 read -t 0.5

stdout:
1
stderr:
toysh34 read -t 0.5

[toysh stdout] Expected '1\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: (
brush34 read -t 0.5

[brush stdout] Expected '1\n', got '2\n'

stdout:
2
stderr:
error: invalid value '0.5' for '-t <SECONDS>': invalid digit found in string

For more information, try '--help'.

osh34 read -t 0.5

[osh stdout] Expected '1\n', got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
  read -t 0.5 < /dev/null
  ^~~~
[ stdin ]:3: fatal: read -t isn't implemented (except t=0)
bash35 read -t -0.5 is invalid

stdout:
1
stderr:
zsh35 read -t -0.5 is invalid

stdout:
stderr: 
zsh: not an identifier: -0.5
toysh35 read -t -0.5 is invalid

[toysh stdout] Expected '2\n', got '127\n'

stdout:
127
stderr:
sh: read: No such file or directory
sush35 read -t -0.5 is invalid

[sush stdout] Expected '2\n', got '1\n'

stdout:
1
stderr:
dash36 read -u

stdout:
stderr: 
mksh36 read -u

stdout:
stderr: 
ksh36 read -u

[ksh stdout] Expected 'reply=hi\n', got ''
[ksh status] Expected 0, got 2

stdout:
stderr: 
E: ksh: <stdin>[5]: read: read-only: 3
toysh36 read -u

[toysh stdout] Expected 'reply=hi\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: (
sush36 read -u

[sush stdout] Expected 'reply=hi\n', got 'reply=\n'

stdout:
reply=
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 3: `-u': invalid name
osh36 read -u

[osh stdout] Expected 'reply=hi\n', got 'reply=\n'

stdout:
reply=
stderr:
  read -u 3 3<<EOF
  ^~~~
[ stdin ]:3: 'read' -u flag not implemented
bash37 read -u syntax error

stdout:
status=1
stderr:
bash: line 1: read: -3: invalid file descriptor specification
zsh37 read -u syntax error

stdout:
status=1
stderr:
toysh37 read -u syntax error

[toysh stdout] Expected 'status=2\n', got 'status=127\n'

stdout:
status=127
stderr:
sh: read: No such file or directory
sush37 read -u syntax error

[sush stdout] Expected 'status=2\n', got ''
[sush status] Expected 0, got 1

stdout:
stderr: 
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: `-u': invalid name
dash38 read -N doesn't respect delimiter, while read -n does

stdout:
stderr: 
ash38 read -N doesn't respect delimiter, while read -n does

stdout:
stderr: 
zsh38 read -N doesn't respect delimiter, while read -n does

stdout:
stderr: 
mksh38 read -N doesn't respect delimiter, while read -n does

stdout:
fooba
fooba
stderr:
ksh38 read -N doesn't respect delimiter, while read -n does

[ksh stdout] Expected 'foo\nfooba\n', got 'fooba\nfooba\n'

stdout:
fooba
fooba
stderr:
toysh38 read -N doesn't respect delimiter, while read -n does

[toysh stdout] Expected 'foo\nfooba\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: (
sush38 read -N doesn't respect delimiter, while read -n does

[sush stdout] Expected 'foo\nfooba\n', got 'foo\n\n'

stdout:
foo

stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: `-N': invalid name
dash39 read -p (not fully tested)

stdout:
stderr: 
zsh39 read -p (not fully tested)

stdout:
stderr: 
mksh39 read -p (not fully tested)

stdout:
stderr: 
ksh39 read -p (not fully tested)

[ksh stdout] Expected 'hi\nh\n', got '\n\n'
[ksh stderr] Expected u'', got 'E: ksh: <stdin>[3]: read: -p: no coprocess\nE: ksh: <stdin>[4]: read: -p: no coprocess\n'

stdout:

stderr:
E: ksh: <stdin>[3]: read: -p: no coprocess
E: ksh: <stdin>[4]: read: -p: no coprocess
toysh39 read -p (not fully tested)

[toysh stdout] Expected 'hi\nh\n', got ''
[toysh stderr] Expected u'', got 'main: line 1: sh: syntax error: (\n'
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: (
sush39 read -p (not fully tested)

[sush stdout] Expected 'hi\nh\n', got '\n\n'
[sush stderr] Expected u'', got "/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 3: `-p': invalid name\n/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: `-p': invalid name\n"

stdout:

stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 3: `-p': invalid name
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: `-p': invalid name
brush39 read -p (not fully tested)

[brush stdout] Expected 'hi\nh\n', got 'Phi\nPh\n'

stdout:
Phi
Ph
stderr:
bash40 read usage

stdout:
status=1
stderr:
bash: line 1: read: -1: invalid number
zsh40 read usage

stdout:
stderr: 
zsh: not an identifier: -1
mksh40 read usage

stdout:
stderr: 
ksh40 read usage

[ksh stdout] Expected 'status=2\n', got ''

stdout:
stderr: 
toysh40 read usage

[toysh stdout] Expected 'status=2\n', got 'status=127\n'

stdout:
status=127
stderr:
sh: read: No such file or directory
sush40 read usage

[sush stdout] Expected 'status=2\n', got 'status=1\n'

stdout:
status=1
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: read: -1: invalid number
dash41 read with smooshed args

stdout:
var=
stderr:
dash: 1: read: Illegal option -n
zsh41 read with smooshed args

stdout:
var=
stderr:
zsh: bad option: -1
toysh41 read with smooshed args

[toysh stdout] Expected 'var=h\n', got 'var=\n'
[toysh status] Expected 0, got 127

stdout:
var=
stderr:
sh: read: No such file or directory
sh: hi: No such file or directory
sush41 read with smooshed args

[sush stdout] Expected 'var=h\n', got 'var=\n'

stdout:
var=
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: read: -1: invalid number
dash42 read -r -d '' for NUL strings, e.g. find -print0

stdout:
stderr: 
zsh42 read -r -d '' for NUL strings, e.g. find -print0

stdout:
stderr: 
mksh42 read -r -d '' for NUL strings, e.g. find -print0

stdout:
stderr: 
ksh42 read -r -d '' for NUL strings, e.g. find -print0

[ksh stdout] Expected '[./a\\b\\c\\d]\n', got '[./a\x08\\d]'

stdout:
[./a\d]
stderr:
toysh42 read -r -d '' for NUL strings, e.g. find -print0

[toysh stdout] Expected '[./a\\b\\c\\d]\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: (
sush42 read -r -d '' for NUL strings, e.g. find -print0

[sush stdout] Expected '[./a\\b\\c\\d]\n', got ''
[sush status] Expected 0, got 101

stdout:
stderr: 
thread 'main' panicked at src/proc_ctrl.rs:181:46:
called `Result::unwrap()` on an `Err` value: NulError(10, [91, 46, 47, 97, 92, 98, 92, 99, 92, 100, 0, 93])
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
mksh43 read from redirected directory is non-fatal error

stdout:
stderr: 
ksh43 read from redirected directory is non-fatal error

[ksh stdout] Expected 'status=1\n', got 'status=2\n'

stdout:
status=2
stderr:
E: ksh: <stdin>[5]: read: Is a directory
toysh43 read from redirected directory is non-fatal error

[toysh stdout] Expected 'status=1\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: (
dash44 read -n from directory

stdout:
stderr: 
ash44 read -n from directory

stdout:
stderr: 
mksh44 read -n from directory

stdout:
stderr: 
ksh44 read -n from directory

[ksh stdout] Expected 'status=1\n', got 'status=2\n'

stdout:
status=2
stderr:
E: ksh: <stdin>[6]: read: Is a directory
toysh44 read -n from directory

[toysh stdout] Expected 'status=1\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: (
bash45 mapfile from directory (bash doesn't handle errors)

stdout:
status=0
stderr:
dash45 mapfile from directory (bash doesn't handle errors)

stdout:
stderr: 
ash45 mapfile from directory (bash doesn't handle errors)

stdout:
stderr: 
zsh45 mapfile from directory (bash doesn't handle errors)

stdout:
stderr: 
mksh45 mapfile from directory (bash doesn't handle errors)

stdout:
stderr: 
ksh45 mapfile from directory (bash doesn't handle errors)

[ksh stdout] Expected 'status=1\n', got 'status=127\n'

stdout:
status=127
stderr:
E: ksh: <stdin>[4]: mapfile: inaccessible or not found
toysh45 mapfile from directory (bash doesn't handle errors)

[toysh stdout] Expected 'status=1\n', got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: (
sush45 mapfile from directory (bash doesn't handle errors)

[sush stdout] Expected 'status=1\n', got 'status=127\n'

stdout:
status=127
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: mapfile: command not found