Results for arith.test.sh

casedashbashmkshzshoshdescription
0N-I pass pass ok pass Side Effect in Array Indexing
detailsdetails
1pass pass pass pass pass Add one to var
2pass pass pass pass pass $ is optional
3pass pass pass pass pass SimpleVarSub within arith
4pass pass pass pass pass BracedVarSub within ArithSub
5pass pass pass pass pass Arith word part
6pass pass pass pass pass Arith sub with word parts
7N-I N-I pass N-I pass Constant with quotes like '1'
detailsdetailsdetails
8pass pass pass pass pass Arith sub within arith sub
9pass pass pass pass pass Backticks within arith sub
10ok ok ok ok ok Invalid string to int
detailsdetailsdetailsdetailsdetails
11N-I N-I N-I N-I pass Invalid string to int with strict-arith
detailsdetailsdetailsdetails
12pass pass pass pass pass Newline in the middle of expression
13pass pass pass pass pass Ternary operator
14N-I pass pass pass pass Preincrement
details
15N-I pass pass pass pass Postincrement
details
16N-I pass pass pass pass Increment undefined variables
details
17N-I pass pass BUG FAIL Increment and decrement array
detailsdetailsdetails
18ok pass BUG BUG pass Increment undefined variables with nounset
detailsdetailsdetails
19N-I pass pass pass pass Comma operator (borrowed from C)
details
20pass pass pass pass pass Augmented assignment
21pass pass pass pass pass Comparison Ops
22pass pass pass pass pass Logical Ops
23N-I pass pass pass pass Logical Ops Short Circuit
details
24pass pass pass pass pass Bitwise ops
25pass pass pass pass pass Unary minus and plus
26pass ok ok BUG pass No floating point
detailsdetailsdetails
27N-I pass pass ok pass Array indexing in arith
detailsdetails
28N-I pass pass pass pass Constants in base 36
details
29N-I pass N-I N-I pass Constants in bases 2 to 64
detailsdetailsdetails
30N-I pass pass pass pass Dynamic base constants
details
31pass pass N-I N-I pass Octal constant
detailsdetails
32pass pass N-I N-I pass Dynamic octal constant
detailsdetails
33pass pass pass pass pass Dynamic hex constants
34pass pass pass pass FAIL Dynamic var names - result of runtime parse/eval
details
35N-I pass pass pass FAIL Bizarre recursive name evaluation - result of runtime parse/eval
detailsdetails
36BUG pass BUG BUG pass nounset with arithmetic
detailsdetailsdetails
37BUG BUG BUG BUG pass Integer Overflow
detailsdetailsdetailsdetails
38N-I ok ok ok pass Invalid LValue
detailsdetailsdetailsdetails
39N-I ok ok ok pass Invalid LValue that looks like array
detailsdetailsdetailsdetails
40N-I ok ok ok pass Invalid LValue: two sets of brackets
detailsdetailsdetailsdetails

144 passed, 19 ok, 28 known unimplemented, 11 known bugs, 3 failed, 0 skipped

Details on runs that didn't PASS

dash0 Side Effect in Array Indexing

stdout:
stderr: 
/bin/dash: 1: Syntax error: "(" unexpected
zsh0 Side Effect in Array Indexing

stdout:
5 b=2
stderr:
dash7 Constant with quotes like '1'

stdout:
stderr: 
/bin/dash: 1: arithmetic expression: expecting primary: "'1' + 2"
bash7 Constant with quotes like '1'

stdout:
stderr: 
/bin/bash: line 1: '1' + 2: syntax error: operand expected (error token is "'1' + 2")
zsh7 Constant with quotes like '1'

stdout:
stderr: 
zsh: bad math expression: illegal character: '
dash10 Invalid string to int

stdout:
stderr: 
/bin/dash: 2: Illegal number: foo
bash10 Invalid string to int

stdout:
5
stderr:
mksh10 Invalid string to int

stdout:
5
stderr:
zsh10 Invalid string to int

stdout:
5
stderr:
osh10 Invalid string to int

stdout:
5
stderr:
osh warning: Invalid integer constant 'foo'
dash11 Invalid string to int with strict-arith

stdout:
stderr: 
/bin/dash: 1: set: Illegal option -o strict-arith
bash11 Invalid string to int with strict-arith

stdout:
foo
5
stderr:
/bin/bash: line 1: set: strict-arith: invalid option name
mksh11 Invalid string to int with strict-arith

stdout:
stderr: 
/bin/mksh: <stdin>[1]: set: strict-arith: bad option
zsh11 Invalid string to int with strict-arith

stdout:
stderr: 
set: no such option: strict-arith
dash14 Preincrement

stdout:
4
4
stderr:
dash15 Postincrement

stdout:
stderr: 
/bin/dash: 2: arithmetic expression: expecting primary: "a++"
dash16 Increment undefined variables

stdout:
[][]
stderr:
/bin/dash: 1: undef1++: not found
/bin/dash: 2: ++undef2: not found
dash17 Increment and decrement array

stdout:
stderr: 
/bin/dash: 1: Syntax error: "(" unexpected
zsh17 Increment and decrement array

stdout:
5 6 7 8 -
stderr:
zsh: a: assignment to invalid subscript range
zsh: undef: assignment to invalid subscript range
osh17 Increment and decrement array

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

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 438, in <module>
    main(sys.argv)
  File "bin/osh", line 425, in main
    sys.exit(OilMain(argv))
  File "bin/osh", line 408, in OilMain
    status = OshMain(main_argv)
  File "bin/osh", line 367, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 849, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 833, in _Execute
    status = self._Dispatch(node, fork_external)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 631, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 842, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 833, in _Execute
    status = self._Dispatch(node, fork_external)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 591, in _Dispatch
    i = self.arith_ev.Eval(node.child)
  File "/home/andy/git/oil/bin/../core/expr_eval.py", line 151, in Eval
    return self._Eval(node)
  File "/home/andy/git/oil/bin/../core/expr_eval.py", line 343, in _Eval
    lhs = self._Eval(node.left)
  File "/home/andy/git/oil/bin/../core/expr_eval.py", line 343, in _Eval
    lhs = self._Eval(node.left)
  File "/home/andy/git/oil/bin/../core/expr_eval.py", line 343, in _Eval
    lhs = self._Eval(node.left)
  File "/home/andy/git/oil/bin/../core/expr_eval.py", line 262, in _Eval
    new_int = old_int + 1
TypeError: cannot concatenate 'str' and 'int' objects
dash18 Increment undefined variables with nounset

stdout:
stderr: 
/bin/dash: 2: undef1++: not found
/bin/dash: 3: ++undef2: not found
/bin/dash: 4: undef1: parameter not set
mksh18 Increment undefined variables with nounset

stdout:
[1][1]
stderr:
zsh18 Increment undefined variables with nounset

stdout:
[1][1]
stderr:
dash19 Comma operator (borrowed from C)

stdout:
stderr: 
/bin/dash: 3: arithmetic expression: expecting EOF: "a,(b+1)"
dash23 Logical Ops Short Circuit

stdout:
11
11
11
11
stderr:
/bin/dash: 2: 1: not found
/bin/dash: 2: x: not found
/bin/dash: 4: 0: not found
/bin/dash: 4: x: not found
/bin/dash: 6: 0: not found
/bin/dash: 8: 1: not found
bash26 No floating point

stdout:
stderr: 
/bin/bash: line 1: 1 + 2.3: syntax error: invalid arithmetic operator (error token is ".3")
mksh26 No floating point

stdout:
stderr: 
/bin/mksh: <stdin>[1]: 1 + 2.3: unexpected '.'
zsh26 No floating point

stdout:
3.2999999999999998
stderr:
dash27 Array indexing in arith

stdout:
stderr: 
/bin/dash: 1: Syntax error: "(" unexpected
zsh27 Array indexing in arith

stdout:
7
stderr:
dash28 Constants in base 36

stdout:
stderr: 
/bin/dash: 1: arithmetic expression: expecting EOF: "36#a"
dash29 Constants in bases 2 to 64

stdout:
stderr: 
/bin/dash: 1: arithmetic expression: expecting EOF: "64#a"
mksh29 Constants in bases 2 to 64

stdout:
stderr: 
/bin/mksh: <stdin>[1]: 64#a: bad number '64#a'
zsh29 Constants in bases 2 to 64

stdout:
stderr: 
zsh: invalid base (must be 2 to 36 inclusive): 64
dash30 Dynamic base constants

stdout:
stderr: 
/bin/dash: 2: arithmetic expression: expecting EOF: " 16#a "
mksh31 Octal constant

stdout:
11
stderr:
zsh31 Octal constant

stdout:
11
stderr:
mksh32 Dynamic octal constant

stdout:
11
stderr:
zsh32 Dynamic octal constant

stdout:
11
stderr:
osh34 Dynamic var names - result of runtime parse/eval

[osh stdout] Expected '11\n', got '6\n'

stdout:
6
stderr:
osh warning: Invalid integer constant 'foo'
dash35 Bizarre recursive name evaluation - result of runtime parse/eval

stdout:
stderr: 
/bin/dash: 5: Illegal number: foo
osh35 Bizarre recursive name evaluation - result of runtime parse/eval

[osh stdout] Expected '6 6 6 6\n', got '6 1 1 1\n'

stdout:
6 1 1 1
stderr:
osh warning: Invalid integer constant 'foo'
osh warning: Invalid integer constant 'bar'
osh warning: Invalid integer constant 'spam'
dash36 nounset with arithmetic

stdout:
should not get here: x=5
stderr:
mksh36 nounset with arithmetic

stdout:
should not get here: x=5
stderr:
zsh36 nounset with arithmetic

stdout:
should not get here: x=5
stderr:
dash37 Integer Overflow

stdout:
-1996229794797103359
stderr:
bash37 Integer Overflow

stdout:
-1996229794797103359
stderr:
mksh37 Integer Overflow

stdout:
-15640831
stderr:
zsh37 Integer Overflow

stdout:
-1996229794797103359
stderr:
dash38 Invalid LValue

stdout:
stderr: 
/bin/dash: 2: Syntax error: word unexpected (expecting ")")
bash38 Invalid LValue

stdout:
9
stderr:
/bin/bash: line 2: ((: (a + 2) = 3 : attempted assignment to non-variable (error token is "= 3 ")
mksh38 Invalid LValue

stdout:
9
stderr:
/bin/mksh: <stdin>[2]:  (a + 2) = 3 : = requires lvalue
zsh38 Invalid LValue

stdout:
9
stderr:
zsh: bad math expression: lvalue required
dash39 Invalid LValue that looks like array

stdout:
status=127
stderr:
/bin/dash: 1: 1[2]: not found
bash39 Invalid LValue that looks like array

stdout:
status=1
stderr:
/bin/bash: line 1: ((: 1[2] = 3 : syntax error: invalid arithmetic operator (error token is "[2] = 3 ")
mksh39 Invalid LValue that looks like array

stdout:
status=2
stderr:
/bin/mksh: <stdin>[1]:  1[2] = 3 : unexpected '['
zsh39 Invalid LValue that looks like array

stdout:
status=2
stderr:
zsh: bad base syntax
dash40 Invalid LValue: two sets of brackets

stdout:
status=127
stderr:
/bin/dash: 1: a[1][2]: not found
bash40 Invalid LValue: two sets of brackets

stdout:
status=1
stderr:
/bin/bash: line 1: ((: a[1][2] = 3 : syntax error: invalid arithmetic operator (error token is "[2] = 3 ")
mksh40 Invalid LValue: two sets of brackets

stdout:
status=2
stderr:
/bin/mksh: <stdin>[1]:  a[1][2] = 3 : unexpected '['
zsh40 Invalid LValue: two sets of brackets

stdout:
status=2
stderr:
zsh: bad base syntax