Results for arith.test.sh

statusoshosh-cpp
pass 6768
ok 33
FAIL 32
total7373
caseoshosh-cppdescription
0pass pass Side Effect in Array Indexing
1pass pass Add one to var
2pass pass $ is optional
3pass pass SimpleVarSub within arith
4pass pass BracedVarSub within ArithSub
5pass pass Arith word part
6pass pass Arith sub with word parts
7pass pass Constant with quotes like '1'
8pass pass Arith sub within arith sub
9pass pass Backticks within arith sub
10ok ok Invalid string to int
detailsdetails
11pass pass Invalid string to int with strict_arith
12pass pass Integer constant parsing
13pass pass Integer constant validation
14pass pass Newline in the middle of expression
15pass pass Ternary operator
16pass pass Preincrement
17pass pass Postincrement
18FAIL FAIL Increment undefined variables
detailsdetails
19FAIL FAIL Increment and decrement array elements
detailsdetails
20FAIL pass Increment undefined variables with nounset
details
21pass pass Comma operator (borrowed from C)
22pass pass Augmented assignment
23pass pass Comparison Ops
24pass pass Logical Ops
25pass pass Logical Ops Short Circuit
26pass pass Bitwise ops
27pass pass Unary minus and plus
28pass pass No floating point
29pass pass Array indexing in arith
30pass pass Constants in base 36
31pass pass Constants in bases 2 to 64
32pass pass Multiple digit constants with base N
33pass pass Dynamic base constants
34pass pass Octal constant
35pass pass Dynamic octal constant
36pass pass Dynamic hex constants
37pass pass Dynamic var names - result of runtime parse/eval
38pass pass Recursive name evaluation is a result of runtime parse/eval
39pass pass nounset with arithmetic
40pass pass 64-bit integer doesn't overflow
41pass pass More 64-bit ops
42pass pass Invalid LValue
43pass pass Invalid LValue that looks like array
44pass pass Invalid LValue: two sets of brackets
45pass pass Operator Precedence
46pass pass Exponentiation with **
47pass pass Exponentiation operator has buggy precedence
48pass pass Negative exponent
49ok ok Comment not allowed in the middle of multiline arithmetic
detailsdetails
50pass pass Add integer to indexed array (a[0] decay)
51pass pass Add integer to associative array (a[0] decay)
52ok ok Double subscript
detailsdetails
53pass pass result of ArithSub -- array[0] decay
54pass pass result of ArithSub -- assoc[0] decay
55pass pass comma operator
56pass pass assignment with dynamic var name
57pass pass array assignment with dynamic array name
58pass pass unary assignment with dynamic var name
59pass pass unary array assignment with dynamic var name
60pass pass Dynamic parsing of arithmetic
61pass pass Dynamic parsing on empty string
62pass pass nested ternary (bug fix)
63pass pass 1 ? a=1 : b=2 ( bug fix)
64pass pass Invalid constant
65pass pass Negative numbers with integer division /
66pass pass Negative numbers with %
67pass pass Negative numbers with bit shift
68pass pass undef[0]
69pass pass undef[0] with nounset
70pass pass s[0] with string abc
71pass pass s[0] with string 42
72pass pass s[0] with string '12 34'
135 passed, 6 OK, 0 not implemented, 0 BUG, 3 failed, 0 timeouts, 0 cases skipped
3 failed under osh

Details on runs that didn't PASS

osh10 Invalid string to int

stdout:
5
stderr:
osh-cpp10 Invalid string to int

stdout:
5
stderr:
osh18 Increment undefined variables

[osh stdout] Expected '[1][1]\n', got ''
[osh status] Expected 0, got 1
[osh stderr] Found 'Traceback (most recent'

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/uke/oil/bin/oils_for_unix.py", line 202, in <module>
    sys.exit(main(sys.argv))
  File "/home/uke/oil/bin/oils_for_unix.py", line 171, in main
    return AppBundleMain(argv)
  File "/home/uke/oil/bin/oils_for_unix.py", line 141, in AppBundleMain
    return shell.Main('osh', arg_r, environ, login_shell, loader, readline)
  File "/home/uke/oil/core/shell.py", line 1213, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/uke/oil/core/main_loop.py", line 375, in Batch
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 2109, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/uke/oil/osh/cmd_eval.py", line 1908, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1681, in _Dispatch
    i = self.arith_ev.EvalToBigInt(node.child)
  File "/home/uke/oil/osh/sh_expr_eval.py", line 553, in EvalToBigInt
    val = self.Eval(node)
  File "/home/uke/oil/osh/sh_expr_eval.py", line 611, in Eval
    old_big, lval = self._EvalLhsAndLookupArith(node.child)
  File "/home/uke/oil/osh/sh_expr_eval.py", line 520, in _EvalLhsAndLookupArith
    location.TokenForArith(node))
  File "/home/uke/oil/osh/sh_expr_eval.py", line 134, in OldValue
    val = cell.val
AttributeError: 'NoneType' object has no attribute 'val'
osh-cpp18 Increment undefined variables

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

stdout:
stderr: 
AddressSanitizer:DEADLYSIGNAL
=================================================================
==2108==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x5568990a00cf bp 0x7ffd6d54cf50 sp 0x7ffd6d54c8a0 T0)
==2108==The signal is caused by a READ memory access.
==2108==Hint: address points to the zero page.
    #0 0x5568990a00ce in sh_expr_eval::OldValue(value_asdl::sh_lvalue_t*, state::Mem*, optview::Exec*, syntax_asdl::loc_t*) _gen/bin/oils_for_unix.mycpp.cc:42390
    #1 0x5568990a451b in sh_expr_eval::ArithEvaluator::_EvalLhsAndLookupArith(syntax_asdl::arith_expr_t*) _gen/bin/oils_for_unix.mycpp.cc:42771
    #2 0x5568990a5f37 in sh_expr_eval::ArithEvaluator::Eval(syntax_asdl::arith_expr_t*) _gen/bin/oils_for_unix.mycpp.cc:42884
    #3 0x5568990a510f in sh_expr_eval::ArithEvaluator::EvalToBigInt(syntax_asdl::arith_expr_t*) _gen/bin/oils_for_unix.mycpp.cc:42807
    #4 0x556899067f79 in cmd_eval::CommandEvaluator::_Dispatch(syntax_asdl::command_t*, runtime_asdl::CommandStatus*) _gen/bin/oils_for_unix.mycpp.cc:38063
    #5 0x55689906a5be in cmd_eval::CommandEvaluator::_Execute(syntax_asdl::command_t*) _gen/bin/oils_for_unix.mycpp.cc:38302
    #6 0x55689906c312 in cmd_eval::CommandEvaluator::ExecuteAndCatch(syntax_asdl::command_t*, int) _gen/bin/oils_for_unix.mycpp.cc:38473
    #7 0x556898fb93f9 in main_loop::Batch(cmd_eval::CommandEvaluator*, cmd_parse::CommandParser*, ui::ErrorFormatter*, int) _gen/bin/oils_for_unix.mycpp.cc:24883
    #8 0x55689917d858 in shell::Main(BigStr*, args::Reader*, Dict<BigStr*, BigStr*>*, bool, pyutil::_ResourceLoader*, py_readline::Readline*) _gen/bin/oils_for_unix.mycpp.cc:59433
    #9 0x556898ee9a73 in oils_for_unix::AppBundleMain(List<BigStr*>*) _gen/bin/oils_for_unix.mycpp.cc:10814
    #10 0x556898ee9fbf in oils_for_unix::main(List<BigStr*>*) _gen/bin/oils_for_unix.mycpp.cc:10846
    #11 0x55689917fd97 in main _gen/bin/oils_for_unix.mycpp.cc:59458
    #12 0x7f04ff17b09a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
    #13 0x556898ec7fd9 in _start (/home/uke/oil/_bin/cxx-asan/oils-for-unix+0x13afd9)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV _gen/bin/oils_for_unix.mycpp.cc:42390 in sh_expr_eval::OldValue(value_asdl::sh_lvalue_t*, state::Mem*, optview::Exec*, syntax_asdl::loc_t*)
==2108==ABORTING
osh19 Increment and decrement array elements

[osh stdout] Expected '6 7 6 7 - 1 1 -1 -1\n', got ''
[osh status] Expected 0, got 1
[osh stderr] Found 'Traceback (most recent'

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/uke/oil/bin/oils_for_unix.py", line 202, in <module>
    sys.exit(main(sys.argv))
  File "/home/uke/oil/bin/oils_for_unix.py", line 171, in main
    return AppBundleMain(argv)
  File "/home/uke/oil/bin/oils_for_unix.py", line 141, in AppBundleMain
    return shell.Main('osh', arg_r, environ, login_shell, loader, readline)
  File "/home/uke/oil/core/shell.py", line 1213, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/uke/oil/core/main_loop.py", line 375, in Batch
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 2109, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/uke/oil/osh/cmd_eval.py", line 1908, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1681, in _Dispatch
    i = self.arith_ev.EvalToBigInt(node.child)
  File "/home/uke/oil/osh/sh_expr_eval.py", line 553, in EvalToBigInt
    val = self.Eval(node)
  File "/home/uke/oil/osh/sh_expr_eval.py", line 817, in Eval
    self.EvalToBigInt(node.left)  # throw away result
  File "/home/uke/oil/osh/sh_expr_eval.py", line 553, in EvalToBigInt
    val = self.Eval(node)
  File "/home/uke/oil/osh/sh_expr_eval.py", line 817, in Eval
    self.EvalToBigInt(node.left)  # throw away result
  File "/home/uke/oil/osh/sh_expr_eval.py", line 553, in EvalToBigInt
    val = self.Eval(node)
  File "/home/uke/oil/osh/sh_expr_eval.py", line 817, in Eval
    self.EvalToBigInt(node.left)  # throw away result
  File "/home/uke/oil/osh/sh_expr_eval.py", line 553, in EvalToBigInt
    val = self.Eval(node)
  File "/home/uke/oil/osh/sh_expr_eval.py", line 611, in Eval
    old_big, lval = self._EvalLhsAndLookupArith(node.child)
  File "/home/uke/oil/osh/sh_expr_eval.py", line 520, in _EvalLhsAndLookupArith
    location.TokenForArith(node))
  File "/home/uke/oil/osh/sh_expr_eval.py", line 134, in OldValue
    val = cell.val
AttributeError: 'NoneType' object has no attribute 'val'
osh-cpp19 Increment and decrement array elements

[osh-cpp stdout] Expected '6 7 6 7 - 1 1 -1 -1\n', got ''
[osh-cpp status] Expected 0, got 1

stdout:
stderr: 
AddressSanitizer:DEADLYSIGNAL
=================================================================
==2139==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x5562b88460cf bp 0x7ffe66e77030 sp 0x7ffe66e76980 T0)
==2139==The signal is caused by a READ memory access.
==2139==Hint: address points to the zero page.
    #0 0x5562b88460ce in sh_expr_eval::OldValue(value_asdl::sh_lvalue_t*, state::Mem*, optview::Exec*, syntax_asdl::loc_t*) _gen/bin/oils_for_unix.mycpp.cc:42390
    #1 0x5562b884a51b in sh_expr_eval::ArithEvaluator::_EvalLhsAndLookupArith(syntax_asdl::arith_expr_t*) _gen/bin/oils_for_unix.mycpp.cc:42771
    #2 0x5562b884bf37 in sh_expr_eval::ArithEvaluator::Eval(syntax_asdl::arith_expr_t*) _gen/bin/oils_for_unix.mycpp.cc:42884
    #3 0x5562b884b10f in sh_expr_eval::ArithEvaluator::EvalToBigInt(syntax_asdl::arith_expr_t*) _gen/bin/oils_for_unix.mycpp.cc:42807
    #4 0x5562b884defc in sh_expr_eval::ArithEvaluator::Eval(syntax_asdl::arith_expr_t*) _gen/bin/oils_for_unix.mycpp.cc:43121
    #5 0x5562b884b10f in sh_expr_eval::ArithEvaluator::EvalToBigInt(syntax_asdl::arith_expr_t*) _gen/bin/oils_for_unix.mycpp.cc:42807
    #6 0x5562b884defc in sh_expr_eval::ArithEvaluator::Eval(syntax_asdl::arith_expr_t*) _gen/bin/oils_for_unix.mycpp.cc:43121
    #7 0x5562b884b10f in sh_expr_eval::ArithEvaluator::EvalToBigInt(syntax_asdl::arith_expr_t*) _gen/bin/oils_for_unix.mycpp.cc:42807
    #8 0x5562b884defc in sh_expr_eval::ArithEvaluator::Eval(syntax_asdl::arith_expr_t*) _gen/bin/oils_for_unix.mycpp.cc:43121
    #9 0x5562b884b10f in sh_expr_eval::ArithEvaluator::EvalToBigInt(syntax_asdl::arith_expr_t*) _gen/bin/oils_for_unix.mycpp.cc:42807
    #10 0x5562b880df79 in cmd_eval::CommandEvaluator::_Dispatch(syntax_asdl::command_t*, runtime_asdl::CommandStatus*) _gen/bin/oils_for_unix.mycpp.cc:38063
    #11 0x5562b88105be in cmd_eval::CommandEvaluator::_Execute(syntax_asdl::command_t*) _gen/bin/oils_for_unix.mycpp.cc:38302
    #12 0x5562b8812312 in cmd_eval::CommandEvaluator::ExecuteAndCatch(syntax_asdl::command_t*, int) _gen/bin/oils_for_unix.mycpp.cc:38473
    #13 0x5562b875f3f9 in main_loop::Batch(cmd_eval::CommandEvaluator*, cmd_parse::CommandParser*, ui::ErrorFormatter*, int) _gen/bin/oils_for_unix.mycpp.cc:24883
    #14 0x5562b8923858 in shell::Main(BigStr*, args::Reader*, Dict<BigStr*, BigStr*>*, bool, pyutil::_ResourceLoader*, py_readline::Readline*) _gen/bin/oils_for_unix.mycpp.cc:59433
    #15 0x5562b868fa73 in oils_for_unix::AppBundleMain(List<BigStr*>*) _gen/bin/oils_for_unix.mycpp.cc:10814
    #16 0x5562b868ffbf in oils_for_unix::main(List<BigStr*>*) _gen/bin/oils_for_unix.mycpp.cc:10846
    #17 0x5562b8925d97 in main _gen/bin/oils_for_unix.mycpp.cc:59458
    #18 0x7f1164e1d09a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
    #19 0x5562b866dfd9 in _start (/home/uke/oil/_bin/cxx-asan/oils-for-unix+0x13afd9)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV _gen/bin/oils_for_unix.mycpp.cc:42390 in sh_expr_eval::OldValue(value_asdl::sh_lvalue_t*, state::Mem*, optview::Exec*, syntax_asdl::loc_t*)
==2139==ABORTING
osh20 Increment undefined variables with nounset

[osh stderr] Found 'Traceback (most recent'

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/uke/oil/bin/oils_for_unix.py", line 202, in <module>
    sys.exit(main(sys.argv))
  File "/home/uke/oil/bin/oils_for_unix.py", line 171, in main
    return AppBundleMain(argv)
  File "/home/uke/oil/bin/oils_for_unix.py", line 141, in AppBundleMain
    return shell.Main('osh', arg_r, environ, login_shell, loader, readline)
  File "/home/uke/oil/core/shell.py", line 1213, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/uke/oil/core/main_loop.py", line 375, in Batch
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 2109, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/uke/oil/osh/cmd_eval.py", line 1908, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1681, in _Dispatch
    i = self.arith_ev.EvalToBigInt(node.child)
  File "/home/uke/oil/osh/sh_expr_eval.py", line 553, in EvalToBigInt
    val = self.Eval(node)
  File "/home/uke/oil/osh/sh_expr_eval.py", line 611, in Eval
    old_big, lval = self._EvalLhsAndLookupArith(node.child)
  File "/home/uke/oil/osh/sh_expr_eval.py", line 520, in _EvalLhsAndLookupArith
    location.TokenForArith(node))
  File "/home/uke/oil/osh/sh_expr_eval.py", line 134, in OldValue
    val = cell.val
AttributeError: 'NoneType' object has no attribute 'val'
osh49 Comment not allowed in the middle of multiline arithmetic

stdout:
6
stderr:
  1 + 2  # not a comment
         ^
[ stdin ]:7: Unexpected token after arithmetic expression (Id.Word_Compound != Id.Arith_RParen)
osh-cpp49 Comment not allowed in the middle of multiline arithmetic

stdout:
6
stderr:
  1 + 2  # not a comment
         ^
[ stdin ]:7: Unexpected token after arithmetic expression (Id.Word_Compound != Id.Arith_RParen)
osh52 Double subscript

stdout:
2
stderr:
  echo $(( a[1][1] ))
               ^
[ stdin ]:3: The [ operator doesn't apply to this expression
osh-cpp52 Double subscript

stdout:
2
stderr:
  echo $(( a[1][1] ))
               ^
[ stdin ]:3: The [ operator doesn't apply to this expression