Results for oil-expr.test.sh

statusosh
pass 52
FAIL 5
total57
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 Set $HOME using 'var' (i.e. Oil string var in word evaluator)
7pass Use shell var in Oil expression
8pass Length in two different contexts
9pass $len(x) inside strings
10pass Func with multiple args in multiple contexts
11pass Trailing Comma in Param list
12pass @range()
13FAIL Wrong sigil $range() shows representation of iterator?
details
14FAIL Wrong sigil @max(3, 4)
details
15FAIL nested expr contexts
details
16pass Test value.Obj inside shell arithmetic
17pass Parse { var x = 42 }
18pass double quoted
19pass double quoted respects strict_array
20pass simple var sub $name $0 $1 $? etc.
21pass braced var sub ${x:-default}
22pass braced var sub respects strict_array
23pass null / true / false
24pass Integer literals
25pass Integer literals with underscores
26pass Backslash char literal (is an integer)
27pass \u{3bc} is char literal
28pass Pound char literal (is an integer)
29pass The literal #''' isn't accepted (use \' instead)
30pass Float Literals
31FAIL Float Literals with _ (requires re2c refinement)
details
32pass Tuples
33pass List comprehension (deferred)
34pass in, not in
35pass Chained Comparisons
36pass dict with 'bare word' keys
37pass dict with expression keys
38pass dict literal with implicit value
39pass Dict literal with string keys
40pass Bitwise logical
41pass Shift operators
42pass Exponentiation with **
43pass Two Kinds of Division
44pass mod operator
45pass Logical operators
46pass x if b else y
47pass multiline strings, list, tuples, etc.
48pass multiline dict
49pass multiline array and command sub (only here docs disallowed)
50pass obj.attr and obj.method()
51pass obj.method does NOT give you a bound method
52pass d->key
53pass a ++ b for string/list concatenation
54pass s ~~ glob and s !~~ glob
55pass Exact equality with === and !==
56FAIL Approximate equality with ~==
details
52 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

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

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

stdout:
stderr: 
  echo $range(10, 15, 2)
  ^~~~
[ stdin ]:2: fatal: Expected function to return a bool, int, float, or string.  Got <type 'xrange'>
osh14 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/travis/build/oilshell/oil/bin/oil.py", line 358, in <module>
    sys.exit(main(sys.argv))
  File "/home/travis/build/oilshell/oil/bin/oil.py", line 301, in main
    return AppBundleMain(argv)
  File "/home/travis/build/oilshell/oil/bin/oil.py", line 261, in AppBundleMain
    loader, line_input)
  File "/home/travis/build/oilshell/oil/core/shell.py", line 675, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/travis/build/oilshell/oil/core/main_loop.py", line 324, in Batch
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags=cmd_flags)
  File "/home/travis/build/oilshell/oil/osh/cmd_eval.py", line 1498, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/travis/build/oilshell/oil/osh/cmd_eval.py", line 1345, in _Execute
    status, check_errexit = self._Dispatch(node, pipeline_st)
  File "/home/travis/build/oilshell/oil/osh/cmd_eval.py", line 599, in _Dispatch
    cmd_val = self.word_ev.EvalWordSequence2(words, allow_assign=True)
  File "/home/travis/build/oilshell/oil/osh/word_eval.py", line 1946, in EvalWordSequence2
    return self.SimpleEvalWordSequence2(words, allow_assign)
  File "/home/travis/build/oilshell/oil/osh/word_eval.py", line 1906, in SimpleEvalWordSequence2
    self._EvalWordToParts(w, False, part_vals)  # not double quoted
  File "/home/travis/build/oilshell/oil/osh/word_eval.py", line 1560, in _EvalWordToParts
    self._EvalWordPart(p, part_vals, quoted=quoted, is_subst=is_subst)
  File "/home/travis/build/oilshell/oil/osh/word_eval.py", line 1529, in _EvalWordPart
    a = [_Stringify(item) for item in func(*pos_args, **named_args)]
TypeError: 'int' object is not iterable
osh15 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/travis/build/oilshell/oil/bin/oil.py", line 358, in <module>
    sys.exit(main(sys.argv))
  File "/home/travis/build/oilshell/oil/bin/oil.py", line 301, in main
    return AppBundleMain(argv)
  File "/home/travis/build/oilshell/oil/bin/oil.py", line 261, in AppBundleMain
    loader, line_input)
  File "/home/travis/build/oilshell/oil/core/shell.py", line 675, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/travis/build/oilshell/oil/core/main_loop.py", line 309, in Batch
    node = c_parser.ParseLogicalLine()  # can raise ParseError
  File "/home/travis/build/oilshell/oil/osh/cmd_parse.py", line 2216, in ParseLogicalLine
    node = self._ParseCommandLine()
  File "/home/travis/build/oilshell/oil/osh/cmd_parse.py", line 2078, in _ParseCommandLine
    child = self.ParseAndOr()
  File "/home/travis/build/oilshell/oil/osh/cmd_parse.py", line 2008, in ParseAndOr
    child = self.ParsePipeline()
  File "/home/travis/build/oilshell/oil/osh/cmd_parse.py", line 1951, in ParsePipeline
    child = self.ParseCommand()
  File "/home/travis/build/oilshell/oil/osh/cmd_parse.py", line 1878, in ParseCommand
    return self.ParseCompoundCommand()
  File "/home/travis/build/oilshell/oil/osh/cmd_parse.py", line 1615, in ParseCompoundCommand
    n8 = self.w_parser.ParseVarDecl(kw_token)
  File "/home/travis/build/oilshell/oil/osh/word_parse.py", line 1018, in ParseVarDecl
    enode, last_token = self.parse_ctx.ParseVarDecl(kw_token, self.lexer)
  File "/home/travis/build/oilshell/oil/frontend/parse_lib.py", line 332, in ParseVarDecl
    pnode, last_token = self.e_parser.Parse(lexer, grammar_nt.oil_var_decl)
  File "/home/travis/build/oilshell/oil/oil_lang/expr_parse.py", line 314, in Parse
    lexer)
  File "/home/travis/build/oilshell/oil/oil_lang/expr_parse.py", line 214, in _PushOilTokens
    node = c_parser.ParseCommandSub()
  File "/home/travis/build/oilshell/oil/osh/cmd_parse.py", line 2252, in ParseCommandSub
    c_list = self._ParseCommandTerm()
  File "/home/travis/build/oilshell/oil/osh/cmd_parse.py", line 2141, in _ParseCommandTerm
    child = self.ParseAndOr()
  File "/home/travis/build/oilshell/oil/osh/cmd_parse.py", line 2008, in ParseAndOr
    child = self.ParsePipeline()
  File "/home/travis/build/oilshell/oil/osh/cmd_parse.py", line 1951, in ParsePipeline
    child = self.ParseCommand()
  File "/home/travis/build/oilshell/oil/osh/cmd_parse.py", line 1925, in ParseCommand
    return self.ParseSimpleCommand()
  File "/home/travis/build/oilshell/oil/osh/cmd_parse.py", line 941, in ParseSimpleCommand
    redirects, words, block = self._ScanSimpleCommand()
  File "/home/travis/build/oilshell/oil/osh/cmd_parse.py", line 674, in _ScanSimpleCommand
    self._Peek()
  File "/home/travis/build/oilshell/oil/osh/cmd_parse.py", line 533, in _Peek
    w = self.w_parser.ReadWord(self.next_lex_mode)
  File "/home/travis/build/oilshell/oil/osh/word_parse.py", line 1748, in ReadWord
    w, need_more = self._ReadWord(lex_mode)
  File "/home/travis/build/oilshell/oil/osh/word_parse.py", line 1688, in _ReadWord
    w = self._ReadCompoundWord(lex_mode)
  File "/home/travis/build/oilshell/oil/osh/word_parse.py", line 1430, in _ReadCompoundWord
    return self._ReadCompoundWord3(lex_mode, Id.Undefined_Tok, True)
  File "/home/travis/build/oilshell/oil/osh/word_parse.py", line 1490, in _ReadCompoundWord3
    self._ParseCallArguments(arglist)
  File "/home/travis/build/oilshell/oil/osh/word_parse.py", line 1351, in _ParseCallArguments
    self.parse_ctx.ParseOilArgList(self.lexer, arglist)
  File "/home/travis/build/oilshell/oil/frontend/parse_lib.py", line 361, in ParseOilArgList
    raise AssertionError()
AssertionError
osh31 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 Approximate equality with ~==

[osh stdout] Expected 'exact\nint-str\nint-float\nstr-float\nint-str-float\n', got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
  shopt -s oil:all
  ^~~~~
[ stdin ]:1: fatal: ~== not implemented