Results for parse-errors.test.sh

casedashbashmkshoshdescription
0pass pass pass pass Bad var sub
1pass ok ok pass Bad braced var sub -- not allowed
detailsdetails
2BUG BUG BUG pass Bad var sub caught at parse time
detailsdetailsdetails
3pass pass ok pass Incomplete while
details
4pass pass ok FAIL Incomplete for
detailsdetails
5pass pass ok pass Incomplete if
details
6pass pass ok FAIL do unexpected
detailsdetails
7pass pass ok pass } is a parse error
details
8BUG pass ok FAIL { is its own word, needs a space
detailsdetailsdetails
9pass pass pass pass } on the second line
10pass BUG ok pass Invalid for loop variable name
detailsdetails
11pass pass pass pass bad var name globally isn't parsed like an assignment
12pass ok ok FAIL bad var name in export
detailsdetailsdetails
13BUG BUG BUG pass bad var name in local
detailsdetailsdetails

33 passed, 11 ok, 0 known unimplemented, 8 known bugs, 4 failed, 0 skipped

Details on runs that didn't PASS

bash1 Bad braced var sub -- not allowed

stdout:
stderr: 
/bin/bash: line 1: ${%}: bad substitution
mksh1 Bad braced var sub -- not allowed

stdout:
stderr: 
/bin/mksh: <stdin>[1]: ${%}: bad substitution
dash2 Bad var sub caught at parse time

stdout:
ok
stderr:
bash2 Bad var sub caught at parse time

stdout:
ok
stderr:
mksh2 Bad var sub caught at parse time

stdout:
ok
stderr:
mksh3 Incomplete while

stdout:
stderr: 
/bin/mksh: <stdin>[1]: syntax error: 'while' unmatched
mksh4 Incomplete for

stdout:
stderr: 
/bin/mksh: <stdin>[1]: syntax error: 'newline' unexpected
osh4 Incomplete for

[osh status] Expected 2, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 411, in <module>
    main(sys.argv)
  File "bin/osh", line 398, in main
    sys.exit(OilMain(argv))
  File "bin/osh", line 381, in OilMain
    status = OshMain(main_argv)
  File "bin/osh", line 292, in OshMain
    node = c_parser.ParseWholeFile()
  File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 1568, in ParseWholeFile
    node = self.ParseCommandTerm()
  File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 1480, in ParseCommandTerm
    child = self.ParseAndOr()
  File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 1349, in ParseAndOr
    left = self.ParsePipeline()
  File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 1284, in ParsePipeline
    child = self.ParseCommand()
  File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 1238, in ParseCommand
    node = self.ParseCompoundCommand()
  File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 1036, in ParseCompoundCommand
    return self.ParseFor()
  File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 797, in ParseFor
    node = self._ParseForEachLoop()
  File "/home/andy/git/oil/bin/../osh/cmd_parse.py", line 735, in _ParseForEachLoop
    ok, iter_name, quoted = word.StaticEval(self.cur_word)
  File "/home/andy/git/oil/bin/../core/word.py", line 88, in StaticEval
    for part in w.parts:
AttributeError: 'TokenWord' object has no attribute 'parts'
mksh5 Incomplete if

stdout:
stderr: 
/bin/mksh: <stdin>[1]: syntax error: 'if' unmatched
mksh6 do unexpected

stdout:
stderr: 
/bin/mksh: <stdin>[1]: syntax error: 'do' unexpected
osh6 do unexpected

[osh status] Expected 2, got 0

stdout:
stderr: 
mksh7 } is a parse error

stdout:
stderr: 
/bin/mksh: <stdin>[1]: syntax error: '}' unexpected
dash8 { is its own word, needs a space

stdout:
status=127
stderr:
/bin/dash: 1: {ls: not found
mksh8 { is its own word, needs a space

stdout:
stderr: 
/bin/mksh: <stdin>[1]: syntax error: '}' unexpected
osh8 { is its own word, needs a space

[osh status] Expected 2, got 127

stdout:
stderr: 
Unexpected error in execvpe('{ls', ['{ls'], ...): [Errno 2] No such file or directory
bash10 Invalid for loop variable name

stdout:
done
stderr:
/bin/bash: line 3: `i.j': not a valid identifier
mksh10 Invalid for loop variable name

stdout:
stderr: 
/bin/mksh: <stdin>[1]: for: bad identifier
bash12 bad var name in export

stdout:
stderr: 
/bin/bash: line 1: export: `FOO-BAR=foo': not a valid identifier
mksh12 bad var name in export

stdout:
stderr: 
/bin/mksh: <stdin>[1]: export: FOO-BAR=foo: is not an identifier
osh12 bad var name in export

[osh status] Expected 2, got 0

stdout:
stderr: 
dash13 bad var name in local

stdout:
stderr: 
bash13 bad var name in local

stdout:
stderr: 
mksh13 bad var name in local

stdout:
stderr: