Results for oil-expr.test.sh

statusosh
pass 53
FAIL 5
total58
caseoshdescription
0pass command sub $(echo hi)
1pass shell array @(a 'b c')
2pass empty array and simple_word_eval (regression test)
3pass Empty array and assignment builtin (regression)
4pass Shell arrays support tilde detection, static globbing, brace detection
5pass augmented assignment doesn't work on shell arrays
6pass Splice in array
7pass Splice in assoc array
8pass Can't splice string
9pass Can't splice undefined
10pass Set $HOME using 'var' (i.e. Oil string var in word evaluator)
11pass Use shell var in Oil expression
12pass Length in two different contexts
13pass $len(x) inside strings
14pass Func with multiple args in multiple contexts
15pass Trailing Comma in Param list
16pass @range()
17FAIL Wrong sigil $range() shows representation of iterator?
details
18FAIL Wrong sigil @max(3, 4)
details
19FAIL nested expr contexts
details
20pass Test value.Obj inside shell arithmetic
21pass Parse { setvar x = 1 }
22pass double quoted
23pass double quoted respects strict_array
24pass single quoted -- implicit and explicit raw
25pass Implicit raw single quote with backslash is a syntax error
26pass single quoted C strings: c'foo\n' and $'foo\n'
27pass simple var sub $name $0 $1 $? etc.
28pass braced var sub ${x:-default}
29pass braced var sub respects strict_array
30pass null / true / false
31pass Integer literals
32pass Float Literals
33FAIL Float Literals with _ (requires re2c refinement)
details
34pass Tuples
35pass List comprehension (deferred)
36pass in, not in
37pass Chained Comparisons
38pass dict with 'bare word' keys
39pass dict with expression keys
40pass dict literal with implicit value
41pass Dict literal with string keys
42pass Bitwise logical
43pass Shift operators
44pass Exponent is ^
45pass Two Kinds of Division
46pass mod operator
47pass Logical operators
48pass x if b else y
49pass multiline strings, list, tuples, etc.
50pass multiline dict
51pass multiline array and command sub (only here docs disallowed)
52pass s ~ regex and s !~ regex
53pass s ~ regex sets a local, not a global
54pass M can be saved and used later (deferred)
55pass obj.attr and obj.method()
56FAIL obj.method does NOT give you a bound method
details
57pass d->key
53 passed, 0 OK, 0 not implemented, 0 BUG, 5 failed, 0 timeouts, 0 cases skipped
5 failed under osh

Details on runs that didn't PASS

osh17 Wrong sigil $range() shows representation of iterator?

[osh stdout] Expected 'TODO\n', got 'xrange(10, 16, 2)\n'

stdout:
xrange(10, 16, 2)
stderr:
osh18 Wrong sigil @max(3, 4)

[osh stdout] Expected 'TODO\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/oil.py", line 375, in <module>
    sys.exit(main(sys.argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 319, in main
    return AppBundleMain(argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 278, in AppBundleMain
    loader, line_input)
  File "/home/andy/git/oilshell/oil/core/shell.py", line 684, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 168, 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 1438, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1318, in _Execute
    status, check_errexit = self._Dispatch(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 540, in _Dispatch
    cmd_val = self.word_ev.EvalWordSequence2(words, allow_assign=True)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1916, in EvalWordSequence2
    return self.StaticEvalWordSequence2(words, allow_assign)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1876, in StaticEvalWordSequence2
    self._EvalWordToParts(w, False, part_vals)  # not double quoted
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1526, in _EvalWordToParts
    self._EvalWordPart(p, part_vals, quoted=quoted, is_subst=is_subst)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1495, in _EvalWordPart
    a = [str(item) for item in func(*pos_args, **named_args)]
TypeError: 'int' object is not iterable
osh19 nested expr contexts

[osh stdout] Expected 'len\n3\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/oil.py", line 375, in <module>
    sys.exit(main(sys.argv))
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 319, in main
    return AppBundleMain(argv)
  File "/home/andy/git/oilshell/oil/bin/oil.py", line 278, in AppBundleMain
    loader, line_input)
  File "/home/andy/git/oilshell/oil/core/shell.py", line 684, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 153, in Batch
    node = c_parser.ParseLogicalLine()  # can raise ParseError
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 2065, in ParseLogicalLine
    node = self._ParseCommandLine()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1927, in _ParseCommandLine
    child = self.ParseAndOr()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1857, in ParseAndOr
    child = self.ParsePipeline()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1803, in ParsePipeline
    child = self.ParseCommand()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1717, in ParseCommand
    return self.ParseCompoundCommand()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1479, in ParseCompoundCommand
    return self.w_parser.ParseVarDecl(kw_token)
  File "/home/andy/git/oilshell/oil/osh/word_parse.py", line 854, in ParseVarDecl
    enode, last_token = self.parse_ctx.ParseVarDecl(kw_token, self.lexer)
  File "/home/andy/git/oilshell/oil/frontend/parse_lib.py", line 331, in ParseVarDecl
    pnode, last_token = self.e_parser.Parse(lexer, grammar_nt.oil_var_decl)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_parse.py", line 311, in Parse
    lexer)
  File "/home/andy/git/oilshell/oil/oil_lang/expr_parse.py", line 215, in _PushOilTokens
    node = c_parser.ParseCommandSub()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 2103, in ParseCommandSub
    c_list = self._ParseCommandTerm()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1990, in _ParseCommandTerm
    child = self.ParseAndOr()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1857, in ParseAndOr
    child = self.ParsePipeline()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1803, in ParsePipeline
    child = self.ParseCommand()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 1777, in ParseCommand
    return self.ParseSimpleCommand()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 826, in ParseSimpleCommand
    redirects, words, block = self._ScanSimpleCommand()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 564, in _ScanSimpleCommand
    self._Peek()
  File "/home/andy/git/oilshell/oil/osh/cmd_parse.py", line 425, in _Peek
    w = self.w_parser.ReadWord(self.next_lex_mode)
  File "/home/andy/git/oilshell/oil/osh/word_parse.py", line 1487, in ReadWord
    w, need_more = self._ReadWord(lex_mode)
  File "/home/andy/git/oilshell/oil/osh/word_parse.py", line 1447, in _ReadWord
    w = self._ReadCompoundWord(lex_mode)
  File "/home/andy/git/oilshell/oil/osh/word_parse.py", line 1188, in _ReadCompoundWord
    return self._ReadCompoundWord3(lex_mode, Id.Undefined_Tok, True)
  File "/home/andy/git/oilshell/oil/osh/word_parse.py", line 1286, in _ReadCompoundWord3
    self._ParseCallArguments(arglist)
  File "/home/andy/git/oilshell/oil/osh/word_parse.py", line 1184, in _ParseCallArguments
    self.parse_ctx.ParseOilArgList(self.lexer, arglist)
  File "/home/andy/git/oilshell/oil/frontend/parse_lib.py", line 360, in ParseOilArgList
    raise AssertionError()
AssertionError
osh33 Float Literals with _ (requires re2c refinement)

[osh stdout] Expected 'less\ngreat\n', got ''
[osh status] Expected 0, got 2

stdout:
stderr: 
  var x = 1.2 + 2_3.0e-1  # 3.5
                    ^~~~
[ stdin ]:2: Syntax error in expression (near Id.Expr_Float)
osh56 obj.method does NOT give you a bound method

[osh stdout] Expected '', got '<built-in method upper of str object at 0x7f7a0ef10058>\n'

stdout:
<built-in method upper of str object at 0x7f7a0ef10058>
stderr: