spec test index / oilshell.org
45 passed, 0 OK, 0 not implemented, 0 BUG, 45 failed, 0 timeouts, 0 cases skipped 4 failed under osh
osh-cpp | 0 /^.$/ [osh-cpp stdout] Expected 'pat=^.$\npat=^.$\nno\nyes\n', got '' [osh-cpp status] Expected 0, got 1 stdout: stderr: echo pat=$pat ^~~~ [ stdin ]:5: fatal: Undefined variable 'pat' |
osh-cpp | 1 /.+/ [osh-cpp stdout] Expected '.+\nyes\nno\n', got '' [osh-cpp status] Expected 0, got 1 stdout: stderr: echo $pat ^~~~ [ stdin ]:4: fatal: Undefined variable 'pat' |
osh-cpp | 2 Positional captures with _match [osh-cpp stdout] Expected "['2020-08', '2020', '08']\n['2020-08', '2020', '08']\n['2020-08', '2020', '08']\n['2020-08']\n" Got '' [osh-cpp status] Expected 0, got 1 stdout: stderr: if [[ $x =~ ([[:digit:]]+)-([[:digit:]]+) ]] { ^~ [ stdin ]:5: fatal: Undefined variable 'x' |
osh-cpp | 3 s ~ regex and s !~ regex [osh-cpp stdout] Expected "matches\n['foo', 'oo']\ndoes not match\n['foo', 'oo']\ncleared\n" Got '' stdout: stderr: |
osh | 4 _start() and _end() [osh stdout] Expected 'start=3 end=6\nstart=3 end=6\n', got '' [osh status] Expected 0, got 1 [osh stderr] Found 'Traceback (most recent' stdout: stderr: Traceback (most recent call last): File "/home/andy/git/oilshell/oil/bin/oils_for_unix.py", line 224, in <module> sys.exit(main(sys.argv)) File "/home/andy/git/oilshell/oil/bin/oils_for_unix.py", line 199, in main return AppBundleMain(argv) File "/home/andy/git/oilshell/oil/bin/oils_for_unix.py", line 146, in AppBundleMain return shell.Main('osh', arg_r, environ, login_shell, loader, readline) File "/home/andy/git/oilshell/oil/core/shell.py", line 910, in Main cmd_flags=cmd_eval.IsMainProgram) File "/home/andy/git/oilshell/oil/core/main_loop.py", line 348, in Batch is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags=cmd_flags) File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1790, in ExecuteAndCatch status = self._Execute(node) File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1616, in _Execute status = self._Dispatch(node, cmd_st) File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1491, in _Dispatch status = self._ExecuteList(if_arm.action) File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1695, in _ExecuteList status = self._Execute(child) File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1616, in _Execute status = self._Dispatch(node, cmd_st) File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 727, in _Dispatch allow_assign=True) File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 2157, in EvalWordSequence2 return self.SimpleEvalWordSequence2(words, allow_assign) File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 2117, in SimpleEvalWordSequence2 self._EvalWordToParts(w, part_vals, 0) # not quoted File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1715, in _EvalWordToParts self._EvalWordPart(p, word_part_vals, eval_flags) File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1672, in _EvalWordPart part_val = self.expr_ev.EvalExprSub(part) File "/home/andy/git/oilshell/oil/ysh/expr_eval.py", line 667, in EvalExprSub py_val = self.EvalExpr(part.child, loc.Missing) File "/home/andy/git/oilshell/oil/ysh/expr_eval.py", line 700, in EvalExpr return self._EvalExpr(node) File "/home/andy/git/oilshell/oil/ysh/expr_eval.py", line 1736, in _EvalExpr return self._EvalFuncCall(node) File "/home/andy/git/oilshell/oil/ysh/expr_eval.py", line 1413, in _EvalFuncCall ret = func(*pos_args, **named_args) File "/home/andy/git/oilshell/oil/ysh/funcs_builtin.py", line 104, in __call__ raise NotImplementedError('_start') NotImplementedError: _start |
osh-cpp | 4 _start() and _end() [osh-cpp stdout] Expected 'start=3 end=6\nstart=3 end=6\n', got '' [osh-cpp status] Expected 0, got 2 stdout: stderr: if (s ~ / word+ <digit+> /) { ^~~~ [ stdin ]:8: 'word' isn't a character class |
osh-cpp | 5 Repeat {1,3} etc. [osh-cpp stdout] Expected '[[:digit:]]{2}\n[[:digit:]]{1,3}\n[[:digit:]]{1,}\n[[:digit:]]{,3}\n' Got '' [osh-cpp status] Expected 0, got 2 stdout: stderr: setvar pat = /d{2}/ ^ [ stdin ]:3: 'd' isn't a character class |
osh-cpp | 6 d+ digit+ !d+ !digit+ [osh-cpp stdout] Expected '[[:digit:]]+\nyes\nno\n[[:digit:]]+\n[^[:digit:]]+\n[^[:digit:]]+\n' Got '' [osh-cpp status] Expected 0, got 2 stdout: stderr: setvar pat = /d+/ ^ [ stdin ]:5: 'd' isn't a character class |
osh-cpp | 7 Alternation and sequence [osh-cpp stdout] Expected '[[:space:]][[:digit:]]+|[[:alpha:][:digit:]_]*\n[[:space:]][[:digit:]]+|[[:alpha:][:digit:]_]*\n' Got '' [osh-cpp status] Expected 0, got 2 stdout: stderr: setvar pat = /s d+ | w*/ ^ [ stdin ]:2: 's' isn't a character class |
osh-cpp | 8 Char Class Ranges [osh-cpp stdout] Expected '[0-9a-f]+\n[0-9a-f]+\nyes\nno\nno\n', got '' [osh-cpp status] Expected 0, got 1 stdout: stderr: echo $pat ^~~~ [ stdin ]:5: fatal: Undefined variable 'pat' |
osh-cpp | 9 Char Class Set [osh-cpp stdout] Expected '[abc]+\nyes\nno\nno\n', got '' [osh-cpp status] Expected 0, got 1 stdout: stderr: echo $pat ^~~~ [ stdin ]:6: fatal: Undefined variable 'pat' |
osh-cpp | 10 Range with escaped characters [osh-cpp stdout] Expected ' 5b 00 2d 0f 5d 0a\n', got '' [osh-cpp status] Expected 0, got 1 stdout: stderr: echo $pat | od -A n -t x1 ^~~~ [ stdin ]:6: fatal: Undefined variable 'pat' echo $pat | od -A n -t x1 ^~~~ [ stdin ]:6: errexit PID 25889: command.Pipeline failed with status 1 |
osh-cpp | 11 Group () [osh-cpp stdout] Expected '(^[[:space:]]|[[:digit:]][[:digit:]])\nyes\nyes\nno\n' Got '' [osh-cpp status] Expected 0, got 2 stdout: stderr: setvar pat = /(%start s or d d)/ ^ [ stdin ]:4: 's' isn't a character class |
osh-cpp | 12 Capture is acceptable as a group [osh-cpp stdout] Expected '(^[[:space:]]|[[:digit:]][[:digit:]])\n', got '' [osh-cpp status] Expected 0, got 2 stdout: stderr: var pat = /<%start s | d d>/ ^ [ stdin ]:2: 's' isn't a character class |
osh | 13 Named captures with _match [osh stdout] Expected "['2020', '08']\n", got '' [osh status] Expected 0, got 3 stdout: stderr: argv.py $[_match('year')] $[_match('month')] ^~~~~~~ [ stdin ]:6: fatal: Type error in expression: Expected an integer, got 'year' |
osh-cpp | 13 Named captures with _match [osh-cpp stdout] Expected "['2020', '08']\n", got '' [osh-cpp status] Expected 0, got 2 stdout: stderr: if (x ~ /<d+ : year> '-' <d+ : month>/) { ^ [ stdin ]:5: 'd' isn't a character class |
osh-cpp | 14 Named Capture Decays Without Name [osh-cpp stdout] Expected '([[:digit:]]+)\nyes\n', got '' [osh-cpp status] Expected 0, got 2 stdout: stderr: var pat = /<d+ : month>/ ^ [ stdin ]:2: 'd' isn't a character class |
osh | 15 Operator ~ assigns named variable [osh stdout] Expected '([[:digit:]]+)\nyes\nTODO MONTH\n', got '([[:digit:]]+)\nyes\n' [osh status] Expected 0, got 1 stdout: ([[:digit:]]+) yesstderr: = month ^~~~~ [ stdin ]:7: fatal: Undefined variable 'month' |
osh-cpp | 15 Operator ~ assigns named variable [osh-cpp stdout] Expected '([[:digit:]]+)\nyes\nTODO MONTH\n', got '' [osh-cpp status] Expected 0, got 2 stdout: stderr: var pat = /<d+ : month>/ ^ [ stdin ]:2: 'd' isn't a character class |
osh-cpp | 16 literal '' [osh-cpp stdout] Expected 'abcdef\nno\nyes\n', got '' [osh-cpp status] Expected 0, got 1 stdout: stderr: echo $pat ^~~~ [ stdin ]:5: fatal: Undefined variable 'pat' |
osh-cpp | 17 Single quotes and splicing (do what "foo $x ${x}" used to) [osh-cpp stdout] Expected 'xxabcxy\nno\nyes\n', got '' [osh-cpp status] Expected 0, got 1 stdout: stderr: echo $pat ^~~~ [ stdin ]:7: fatal: Undefined variable 'pat' |
osh-cpp | 18 @splice [osh-cpp stdout] Expected '[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+\nyes\nno\n' Got '' [osh-cpp status] Expected 0, got 2 stdout: stderr: var d = /d+/; ^ [ stdin ]:2: 'd' isn't a character class |
osh-cpp | 19 splice with capital letters [osh-cpp stdout] Expected '[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+\nyes\nno\n' Got '' [osh-cpp status] Expected 0, got 2 stdout: stderr: var D = /d+/; ^ [ stdin ]:2: 'd' isn't a character class |
osh-cpp | 20 Matching escaped tab character [osh-cpp stdout] Expected u'pat=(a[\t]b)\naa\tbb\n', got '' [osh-cpp status] Expected 0, got 1 stdout: stderr: write pat=$pat ^~~~ [ stdin ]:6: fatal: Undefined variable 'pat' |
osh-cpp | 21 Match unicode char [osh-cpp stdout] Expected 'yes\nyes\nno\n', got 'no\nno\nno\n' stdout: no no nostderr: |
osh | 22 Match non-ASCII byte denoted using $'\xff' (TODO: LANG=C) [osh stdout] Expected ' 5b ff 5d 0a\nyes\nno\n', got '' [osh status] Expected 0, got 1 stdout: stderr: var pat = /[ $'\xff' ]/; ^~ [ stdin ]:2: fatal: Use unquoted char literal for byte 255, which is >= 128 (avoid confusing a set of bytes with a sequence) |
osh-cpp | 22 Match non-ASCII byte denoted using $'\xff' (TODO: LANG=C) [osh-cpp stdout] Expected ' 5b ff 5d 0a\nyes\nno\n', got '' [osh-cpp status] Expected 0, got 1 stdout: stderr: echo $pat | od -A n -t x1 ^~~~ [ stdin ]:4: fatal: Undefined variable 'pat' echo $pat | od -A n -t x1 ^~~~ [ stdin ]:4: errexit PID 26822: command.Pipeline failed with status 1 |
osh-cpp | 23 Match non-ASCII byte denoted using \xff [osh-cpp stdout] Expected ' 5b ff 5d 0a\n', got '' [osh-cpp status] Expected 0, got 1 stdout: stderr: echo $pat | od -A n -t x1 ^~~~ [ stdin ]:4: fatal: Undefined variable 'pat' echo $pat | od -A n -t x1 ^~~~ [ stdin ]:4: errexit PID 26885: command.Pipeline failed with status 1 |
osh-cpp | 24 ERE can express Unicode escapes that are in the ASCII range [osh-cpp stdout] Expected ' 5b 7f 5d 0a\nyes\nno\nequal\nyes\nno\n', got '' [osh-cpp status] Expected 0, got 1 stdout: stderr: echo $pat | od -A n -t x1 ^~~~ [ stdin ]:4: fatal: Undefined variable 'pat' echo $pat | od -A n -t x1 ^~~~ [ stdin ]:4: errexit PID 26935: command.Pipeline failed with status 1 |
osh-cpp | 26 non-ASCII bytes must be singleton terms, e.g. '\x7f\xff' is disallowed [osh-cpp stdout] Expected u'', got '\n' [osh-cpp status] Expected 1, got 0 stdout: stderr: |
osh-cpp | 27 Matching escaped tab character [osh-cpp stdout] Expected u'pat=(a[\t]b)\naa\tbb\n', got '' [osh-cpp status] Expected 0, got 1 stdout: stderr: write pat=$pat ^~~~ [ stdin ]:6: fatal: Undefined variable 'pat' |
osh-cpp | 28 Repeated String Literal With Single Char [osh-cpp stdout] Expected '^f+$\n^(f)+$\nyes\nno\n', got '' [osh-cpp status] Expected 0, got 1 stdout: stderr: echo $pat ^~~~ [ stdin ]:7: fatal: Undefined variable 'pat' |
osh-cpp | 30 Instead of $'foo\\bar' use 'foo' \\ 'bar' [osh-cpp stdout] Expected 'foo\\\\bar\nyes\nno\n', got '' [osh-cpp status] Expected 0, got 1 stdout: stderr: echo $pat ^~~~ [ stdin ]:3: fatal: Undefined variable 'pat' |
osh-cpp | 31 Negation of Character Class ![a-z] [osh-cpp stdout] Expected '[^a-z]\nyes\nno\n', got '' [osh-cpp status] Expected 0, got 1 stdout: stderr: echo $pat ^~~~ [ stdin ]:4: fatal: Undefined variable 'pat' |
osh-cpp | 32 Posix and Perl class in class literals [osh-cpp stdout] Expected '[[:space:]z]\n[[:digit:]z]\n', got '' [osh-cpp status] Expected 0, got 1 stdout: stderr: echo $pat ^~~~ [ stdin ]:6: fatal: Undefined variable 'pat' |
osh-cpp | 34 [!digit] can't be negated in POSIX ERE (but yes in Perl) [osh-cpp stdout] Expected u'', got '\n' [osh-cpp status] Expected 1, got 0 stdout: stderr: |
osh-cpp | 35 Long Python Example [osh-cpp stdout] Expected 'Y\nN\nY decimal\nN decimal\nY binary\nN binary\nY octal\nN octal\nY hex\nN hex\n' Got '' stdout: stderr: |
osh-cpp | 36 Invalid sh operation on eggex [osh-cpp status] Expected 1, got 2 stdout: stderr: var pat = / d+ / ^ [ stdin ]:1: 'd' isn't a character class |
osh-cpp | 37 Regex in a loop (bug regression) [osh-cpp stdout] Expected '1\n2\n', got '' [osh-cpp status] Expected 0, got 2 stdout: stderr: if (Str(line) ~ / s* 'imports' s* '=' s* .* /) { ^ [ stdin ]:8: 's' isn't a character class |
osh-cpp | 38 Regex in a loop depending on var [osh-cpp stdout] Expected 'line foo\nmatched foo\nline bar\nmatched bar\n' Got '' stdout: stderr: |
osh-cpp | 39 Regex with [ (bug regression) [osh-cpp stdout] Expected 'sq\nchar class\n', got '' [osh-cpp status] Expected 0, got 2 stdout: stderr: if ("a" ~ / s* 'imports' s* '=' s* '[' /) { ^ [ stdin ]:11: 's' isn't a character class |
osh-cpp | 41 Operator chars in char classes (eggex) [osh-cpp stdout] Expected 'hyphen\nbackslash\nright bracket\nleft bracket\nperiod\ncaret\nno way to have [^]\n' Got '' [osh-cpp status] Expected 0, got 1 stdout: stderr: [[ '\' =~ $pat ]] && echo backslash ^~~~ [ stdin ]:8: fatal: Undefined variable 'pat' |
osh-cpp | 42 Matching ] and \ and ' and " in character classes [osh-cpp stdout] Expected 'pat=[]\'"\\\\]\nbackslash \\\nrbracket ]\nsq \'\ndq "\n' Got '' [osh-cpp status] Expected 0, got 1 stdout: stderr: write pat=$pat ^~~~ [ stdin ]:13: fatal: Undefined variable 'pat' |
osh-cpp | 43 Matching literal hyphen in character classes [osh-cpp stdout] Expected 'pat=[ab-]\nc-d\nab\n', got '' [osh-cpp status] Expected 0, got 1 stdout: stderr: write pat=$pat ^~~~ [ stdin ]:5: fatal: Undefined variable 'pat' |
osh-cpp | 44 Char class special: ^ - ] \ [osh-cpp stdout] Expected 'caret=[x^]\ncaret2=[x^]\ncaret3=[x^]\nmatch x\nmatch ^\n---\nhyphen=[ab-]\nhyphen2=[ab-]\nmatch -\nmatch a\n---\nrbracket=[][]\nrbracket2=[][]\nmatch [\nmatch ]\n---\nbackslash=[xn\\\\]\nbackslash2=[xn\\\\]\nbackslash3=[xn\\\\]\nmatch x\nmatch n\nmatch backslash\n' Got '' [osh-cpp status] Expected 0, got 1 stdout: stderr: echo caret=$caret ^~~~~~ [ stdin ]:5: fatal: Undefined variable 'caret' |