Results for builtin-read.test.sh

statusbashmkshzshashosh
pass 5833264562
ok-4 00001
ok-3 01110
ok-2 02330
ok 35220
N-I 01124120
BUG-2 01000
BUG 311810
FAIL 00001
total6464646464
casebashmkshzshashoshdescription
0pass pass pass pass pass read line from here doc
1pass pass pass pass pass read from empty file
2pass pass pass pass pass read /dev/null
3pass pass pass pass pass read with zero args
4pass pass pass pass pass read builtin with no newline returns status 1
5pass pass pass pass pass read builtin splits value across multiple vars
6pass pass pass pass pass read builtin with too few variables
7pass pass N-I pass pass read -n (with $REPLY)
details
8pass pass N-I pass pass IFS= read -n (OSH regression: value saved in tempenv)
details
9pass BUG N-I pass pass read -n doesn't strip whitespace (bug fix)
detailsdetails
10pass BUG N-I N-I pass read -d -n - respects delimiter and splits
detailsdetailsdetails
11ok pass N-I pass pass read -n with invalid arg
detailsdetails
12pass pass N-I N-I pass read -n from pipe
detailsdetails
13pass BUG BUG pass pass read without args uses $REPLY, no splitting occurs (without -n)
detailsdetails
14pass BUG N-I N-I pass read -n vs. -N
detailsdetailsdetails
15pass pass N-I N-I pass read -N ignores delimiters
detailsdetails
16pass pass BUG pass pass read will unset extranous vars
details
17pass pass pass pass pass read -r ignores backslashes
18pass BUG BUG pass pass read -r with other backslash escapes
detailsdetails
19pass pass pass pass pass read with line continuation reads multiple physical lines
20pass pass pass pass pass read multiple vars spanning many lines
21pass BUG BUG pass pass read -r with \n
detailsdetails
22pass pass N-I pass pass read -s from pipe, not a terminal
details
23pass pass pass pass pass read with IFS=$'\n'
24pass pass pass pass pass read multiple lines with IFS=:
25pass pass pass pass pass read with IFS=''
26pass BUG BUG BUG pass read does not respect C backslash escapes
detailsdetailsdetails
27pass pass pass pass pass dynamic scope used to set vars
28pass N-I N-I N-I pass read -a reads into array
detailsdetailsdetails
29pass pass pass pass pass read -d : (colon-separated records)
30pass pass pass pass pass read -d '' (null-separated records)
31pass pass pass pass pass read -rd
32pass pass pass pass pass read -d when there's no delimiter
33pass N-I N-I pass pass read -t 0 tests if input is available
detailsdetails
34pass BUG BUG pass FAIL read -t 0.5
detailsdetailsdetails
35BUG pass BUG pass pass read -t -0.5 is invalid
detailsdetails
36pass N-I pass pass pass read -u
details
37ok pass ok pass pass read -u syntax error
detailsdetails
38pass N-I pass pass pass read -u -s
details
39pass N-I pass pass pass read -u 3 -d 5
details
40pass BUG N-I N-I pass read -u 3 -d b -N 6
detailsdetailsdetails
41pass ok N-I N-I pass read -N doesn't respect delimiter, while read -n does
detailsdetailsdetails
42pass N-I N-I pass pass read -p (not fully tested)
detailsdetails
43ok BUG BUG pass pass read usage
detailsdetailsdetails
44pass pass N-I pass pass read with smooshed args
details
45pass N-I N-I pass pass read -r -d '' for NUL strings, e.g. find -print0
detailsdetails
46pass ok pass pass pass read from redirected directory is non-fatal error
details
47pass ok pass N-I pass read -n from directory
detailsdetails
48BUG N-I N-I N-I pass mapfile from directory (bash doesn't handle errors)
detailsdetailsdetailsdetails
49pass pass N-I ok pass read -n 0
detailsdetails
50pass ok N-I ok pass read -n and backslash escape
detailsdetailsdetails
51pass ok-3 N-I ok-2 pass read -n 4 with incomplete backslash
detailsdetailsdetails
52pass ok-2 N-I ok-2 pass read -n 4 with backslash + delim
detailsdetailsdetails
53pass ok-2 ok-2 pass pass "backslash + newline" should be swallowed regardless of "-d <delim>"
detailsdetails
54pass N-I N-I N-I pass empty input and splitting
detailsdetailsdetails
55pass N-I N-I N-I pass IFS='x ' read -a: trailing spaces (unlimited split)
detailsdetailsdetails
56pass pass pass pass pass IFS='x ' read a b: trailing spaces (with max_split)
57pass N-I N-I N-I pass IFS='x ' read -a: intermediate spaces (unlimited split)
detailsdetailsdetails
58pass pass pass pass pass IFS='x ' incomplete backslash
59pass ok ok pass pass IFS='\ ' and backslash escaping
detailsdetails
60pass pass pass pass pass max_split and backslash escaping
61pass pass ok-2 pass pass IFS=x read a b <<< xxxxxx
details
62pass BUG ok-2 ok-2 pass read and "\ "
detailsdetailsdetails
63BUG BUG-2 ok-3 ok-3 ok-4 read bash bug
detailsdetailsdetailsdetailsdetails
224 passed, 24 OK, 47 not implemented, 24 BUG, 1 failed, 0 timeouts, 0 cases skipped
1 failed under osh

Details on runs that didn't PASS

zsh7 read -n (with $REPLY)

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

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:
zsh9 read -n doesn't strip whitespace (bug fix)

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:
zsh10 read -d -n - respects delimiter and splits

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

stdout:
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: 
zsh12 read -n from pipe

stdout:
stderr: 
ash12 read -n from pipe

stdout:
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:
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:
mksh14 read -n vs. -N

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

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

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

stdout:
stderr: 
zsh15 read -N ignores delimiters

stdout:
stderr: 
ash15 read -N ignores delimiters

stdout:
stderr: 
zsh16 read will unset extranous vars

stdout:
'a' 'b' ''
'b' '' ''
stderr:
mksh18 read -r with other backslash escapes

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

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

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

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

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

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

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

stdout:
abcdefghx65 145 i
stderr:
mksh28 read -a reads into array

stdout:
stderr: 
zsh28 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
mksh33 read -t 0 tests if input is available

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

stdout:
stderr: 
mksh34 read -t 0.5

stdout:
1
stderr:
zsh34 read -t 0.5

stdout:
1
stderr:
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
mksh36 read -u

stdout:
stderr: 
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:
mksh38 read -u -s

stdout:
stderr: 
mksh39 read -u 3 -d 5

stdout:
stderr: 
mksh40 read -u 3 -d b -N 6

stdout:
stderr: 
mksh: <stdin>[5]: read: read-only: 3
mksh: <stdin>[8]: read: read-only: 3
zsh40 read -u 3 -d b -N 6

stdout:
stderr: 
ash40 read -u 3 -d b -N 6

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

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

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

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

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

stdout:
stderr: 
bash43 read usage

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

stdout:
stderr: 
zsh43 read usage

stdout:
stderr: 
zsh: not an identifier: -1
zsh44 read with smooshed args

stdout:
var=
stderr:
zsh: bad option: -1
mksh45 read -r -d '' for NUL strings, e.g. find -print0

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

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

stdout:
stderr: 
mksh47 read -n from directory

stdout:
stderr: 
ash47 read -n from directory

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

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

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

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

stdout:
stderr: 
zsh49 read -n 0

stdout:
stderr: 
ash49 read -n 0

stdout:
['abcdef']
stderr:
mksh50 read -n and backslash escape

stdout:
['a\x08d\x1b']
['a ']
stderr:
zsh50 read -n and backslash escape

stdout:
stderr: 
ash50 read -n and backslash escape

stdout:
['abc']
['a  ']
stderr:
mksh51 read -n 4 with incomplete backslash

stdout:
['abc']
['']
stderr:
zsh51 read -n 4 with incomplete backslash

stdout:
stderr: 
ash51 read -n 4 with incomplete backslash

stdout:
['abc']
['   ']
stderr:
mksh52 read -n 4 with backslash + delim

stdout:
['abc']
stderr:
zsh52 read -n 4 with backslash + delim

stdout:
stderr: 
ash52 read -n 4 with backslash + delim

stdout:
['abc']
stderr:
mksh53 "backslash + newline" should be swallowed regardless of "-d <delim>"

stdout:
['a bc d']
['a b,c d']
['a b\nc d']
['a bc d']
stderr:
zsh53 "backslash + newline" should be swallowed regardless of "-d <delim>"

stdout:
['a bc d']
['a b,c d']
['a b\nc d']
['a bc d']
stderr:
mksh54 empty input and splitting

stdout:
stderr: 
zsh54 empty input and splitting

stdout:
stderr: 
ash54 empty input and splitting

stdout:
stderr: 
mksh55 IFS='x ' read -a: trailing spaces (unlimited split)

stdout:
stderr: 
zsh55 IFS='x ' read -a: trailing spaces (unlimited split)

stdout:
stderr: 
ash55 IFS='x ' read -a: trailing spaces (unlimited split)

stdout:
stderr: 
mksh57 IFS='x ' read -a: intermediate spaces (unlimited split)

stdout:
stderr: 
zsh57 IFS='x ' read -a: intermediate spaces (unlimited split)

stdout:
stderr: 
ash57 IFS='x ' read -a: intermediate spaces (unlimited split)

stdout:
stderr: 
mksh59 IFS='\ ' and backslash escaping

stdout:
['hello', 'world  test']
['hello', ' world  test']
stderr:
zsh59 IFS='\ ' and backslash escaping

stdout:
['hello', 'world  test']
['hello', ' world  test']
stderr:
zsh61 IFS=x read a b <<< xxxxxx

stdout:
['', '']
['', 'x']
['', 'xx']
['', 'xxx']
['', 'xxxx']
-- spaces --
['', '']
['', 'x']
['', 'xx']
['', 'xxx']
['', 'xxxx']
-- with char --
['', 'a']
['', 'ax']
['', 'axx']
['', 'axxx']
['', 'axxxx']
stderr:
mksh62 read and "\ "

stdout:
-- xs... --
['', '']
['', '']
['', ' ']
['', '  ']
-- xe... --
['', '']
['', ' ']
['', '  ']
['', '']
['', '']
['', '']
stderr:
zsh62 read and "\ "

stdout:
-- xs... --
['', '']
['', '']
['', '']
['', '']
-- xe... --
['', '']
['', '']
['', '']
['', '']
['', '']
['', '']
stderr:
ash62 read and "\ "

stdout:
-- xs... --
['', '']
['', '']
['', '']
['', '']
-- xe... --
['', '']
['', '']
['', '']
['', '']
['', '']
['', '']
stderr:
bash63 read bash bug

stdout:
['', '\x01']
stderr:
mksh63 read bash bug

stdout:
['', '  ']
stderr:
zsh63 read bash bug

stdout:
['', '']
stderr:
ash63 read bash bug

stdout:
['', '']
stderr:
osh63 read bash bug

stdout:
['', ' ']
stderr: