Results for arith.test.sh

statusdashbashmkshzshoshosh_ALT
pass 254743395757
ok 576855
N-I 2827500
BUG 4661000
total626262626262
casedashbashmkshzshoshosh_ALTdescription
0N-I pass pass ok pass pass Side Effect in Array Indexing
detailsdetails
1pass pass pass pass pass pass Add one to var
2pass pass pass pass pass pass $ is optional
3pass pass pass pass pass pass SimpleVarSub within arith
4pass pass pass pass pass pass BracedVarSub within ArithSub
5pass pass pass pass pass pass Arith word part
6pass pass pass pass pass pass Arith sub with word parts
7N-I N-I pass N-I pass pass Constant with quotes like '1'
detailsdetailsdetails
8pass pass pass pass pass pass Arith sub within arith sub
9pass pass pass pass pass pass Backticks within arith sub
10ok ok ok ok ok ok Invalid string to int
detailsdetailsdetailsdetailsdetailsdetails
11ok N-I N-I N-I pass pass Invalid string to int with strict_arith
detailsdetailsdetailsdetails
12pass pass pass pass pass pass Newline in the middle of expression
13pass pass pass pass pass pass Ternary operator
14N-I pass pass pass pass pass Preincrement
details
15N-I pass pass pass pass pass Postincrement
details
16N-I pass pass pass pass pass Increment undefined variables
details
17N-I pass pass BUG pass pass Increment and decrement array elements
detailsdetails
18ok pass BUG BUG pass pass Increment undefined variables with nounset
detailsdetailsdetails
19N-I pass pass pass pass pass Comma operator (borrowed from C)
details
20pass pass pass pass pass pass Augmented assignment
21pass pass pass pass pass pass Comparison Ops
22pass pass pass pass pass pass Logical Ops
23N-I pass pass pass pass pass Logical Ops Short Circuit
details
24pass pass pass pass pass pass Bitwise ops
25pass pass pass pass pass pass Unary minus and plus
26pass ok ok BUG pass pass No floating point
detailsdetailsdetails
27N-I pass pass ok pass pass Array indexing in arith
detailsdetails
28N-I pass pass pass pass pass Constants in base 36
details
29N-I pass N-I N-I pass pass Constants in bases 2 to 64
detailsdetailsdetails
30N-I pass pass pass pass pass Multiple digit constants with base N
details
31N-I pass pass pass pass pass Dynamic base constants
details
32pass pass N-I N-I pass pass Octal constant
detailsdetails
33pass pass N-I N-I pass pass Dynamic octal constant
detailsdetails
34pass pass pass pass pass pass Dynamic hex constants
35pass pass pass pass ok ok Dynamic var names - result of runtime parse/eval
detailsdetails
36N-I pass pass pass ok ok Bizarre recursive name evaluation - result of runtime parse/eval
detailsdetailsdetails
37BUG pass BUG BUG pass pass nounset with arithmetic
detailsdetailsdetails
38BUG BUG BUG BUG pass pass Integer Overflow
detailsdetailsdetailsdetails
39N-I ok ok ok pass pass Invalid LValue
detailsdetailsdetailsdetails
40N-I ok ok ok pass pass Invalid LValue that looks like array
detailsdetailsdetailsdetails
41N-I ok ok ok pass pass Invalid LValue: two sets of brackets
detailsdetailsdetailsdetails
42pass pass pass pass pass pass Operator Precedence
43N-I pass N-I pass pass pass Exponentiation with **
detailsdetails
44N-I pass N-I pass pass pass Exponentiation operator has buggy precedence
detailsdetails
45N-I pass pass ok pass pass Negative exponent
detailsdetails
46ok ok pass pass ok ok Comment not allowed in the middle of multiline arithmetic
detailsdetailsdetailsdetails
47N-I BUG pass pass pass pass Can't add integer to indexed array
detailsdetails
48BUG BUG BUG BUG pass pass Can't add integer to associative array
detailsdetailsdetailsdetails
49N-I pass pass ok ok ok Double subscript
detailsdetailsdetailsdetails
50N-I BUG BUG pass pass pass result of ArithSub is array
detailsdetailsdetails
51N-I BUG N-I BUG pass pass result of ArithSub is assoc array
detailsdetailsdetailsdetails
52N-I ok ok pass pass pass comma operator
detailsdetailsdetails
53pass pass pass pass pass pass assignment with dynamic var name
54N-I pass pass BUG pass pass array assignment with dynamic array name
detailsdetails
55BUG pass pass pass pass pass unary assignment with dynamic var name
details
56N-I pass pass BUG pass pass unary array assignment with dynamic var name
detailsdetails
57N-I pass BUG pass pass pass shopt -s eval_unsafe_arith
detailsdetails
58pass pass pass pass pass pass eval_unsafe_arith on empty string
59pass pass pass pass pass pass nested ternary (bug fix)
60pass pass pass BUG pass pass 1 ? a=1 : b=2 ( bug fix)
details
61ok BUG pass pass pass pass Invalid constant
detailsdetails
268 passed, 36 OK, 42 not implemented, 26 BUG, 0 failed, 0 timeouts, 0 cases skipped

Details on runs that didn't PASS

dash0 Side Effect in Array Indexing

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

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

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

stdout:
stderr: 
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: 
dash: 1: shopt: not found
dash: 3: Illegal number: foo
bash10 Invalid string to int

stdout:
5
stderr:
bash: line 1: shopt: strict_arith: invalid shell option name
mksh10 Invalid string to int

stdout:
5
stderr:
mksh: <stdin>[1]: shopt: not found
zsh10 Invalid string to int

stdout:
5
stderr:
zsh: command not found: shopt
osh10 Invalid string to int

stdout:
5
stderr:
osh_ALT10 Invalid string to int

stdout:
5
stderr:
dash11 Invalid string to int with strict_arith

stdout:
foo
stderr:
dash: 1: shopt: not found
dash: 4: Illegal number: foo
bash11 Invalid string to int with strict_arith

stdout:
foo
5
should not get here
stderr:
bash: line 1: shopt: strict_arith: invalid shell option name
mksh11 Invalid string to int with strict_arith

stdout:
foo
5
should not get here
stderr:
mksh: <stdin>[1]: shopt: not found
zsh11 Invalid string to int with strict_arith

stdout:
foo
5
should not get here
stderr:
zsh: command not found: shopt
dash14 Preincrement

stdout:
4
4
stderr:
dash15 Postincrement

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

stdout:
[][]
stderr:
dash: 1: shopt: not found
dash: 2: undef1++: not found
dash: 3: ++undef2: not found
dash17 Increment and decrement array elements

stdout:
stderr: 
dash: 1: shopt: not found
dash: 2: Syntax error: "(" unexpected
zsh17 Increment and decrement array elements

stdout:
5 6 7 8 -
stderr:
zsh: command not found: shopt
zsh: a: assignment to invalid subscript range
zsh: undef: assignment to invalid subscript range
dash18 Increment undefined variables with nounset

stdout:
stderr: 
dash: 2: undef1++: not found
dash: 3: ++undef2: not found
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: 
dash: 3: arithmetic expression: expecting EOF: "a,(b+1)"
dash23 Logical Ops Short Circuit

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

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

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

stdout:
3.2999999999999998
stderr:
dash27 Array indexing in arith

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

stdout:
7
stderr:
dash28 Constants in base 36

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

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

stdout:
stderr: 
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 Multiple digit constants with base N

stdout:
stderr: 
dash: 1: arithmetic expression: expecting EOF: "10#0123"
dash31 Dynamic base constants

stdout:
stderr: 
dash: 2: arithmetic expression: expecting EOF: " 16#a "
mksh32 Octal constant

stdout:
11
stderr:
zsh32 Octal constant

stdout:
11
stderr:
mksh33 Dynamic octal constant

stdout:
11
stderr:
zsh33 Dynamic octal constant

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

stdout:
6
stderr:
osh_ALT35 Dynamic var names - result of runtime parse/eval

stdout:
6
stderr:
dash36 Bizarre recursive name evaluation - result of runtime parse/eval

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

stdout:
6 1 1 1
stderr:
osh_ALT36 Bizarre recursive name evaluation - result of runtime parse/eval

stdout:
6 1 1 1
stderr:
dash37 nounset with arithmetic

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

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

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

stdout:
-1996229794797103359
stderr:
bash38 Integer Overflow

stdout:
-1996229794797103359
stderr:
mksh38 Integer Overflow

stdout:
-15640831
stderr:
zsh38 Integer Overflow

stdout:
-1996229794797103359
stderr:
dash39 Invalid LValue

stdout:
stderr: 
dash: 2: Syntax error: word unexpected (expecting ")")
bash39 Invalid LValue

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

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

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

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

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

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

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

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

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

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

stdout:
status=2
stderr:
zsh: bad base syntax
dash43 Exponentiation with **

stdout:
stderr: 
dash: 1: arithmetic expression: expecting primary: " 3 ** 0 "
mksh43 Exponentiation with **

stdout:
stderr: 
mksh: <stdin>[1]:  3 ** 0 : unexpected '*'
dash44 Exponentiation operator has buggy precedence

stdout:
stderr: 
dash: 1: arithmetic expression: expecting primary: " -3 ** 2 "
mksh44 Exponentiation operator has buggy precedence

stdout:
stderr: 
mksh: <stdin>[1]:  -3 ** 2 : unexpected '*'
dash45 Negative exponent

stdout:
stderr: 
dash: 1: arithmetic expression: expecting primary: " 2**-1 * 5 "
zsh45 Negative exponent

stdout:
2.5
stderr:
dash46 Comment not allowed in the middle of multiline arithmetic

stdout:
6
stderr:
dash: 6: arithmetic expression: expecting EOF: "
1 + 2  # not a comment
"
bash46 Comment not allowed in the middle of multiline arithmetic

stdout:
6
[]
stderr:
bash: line 8: 
1 + 2  # not a comment
: syntax error: invalid arithmetic operator (error token is "# not a comment
")
bash: line 10: ((: a = 3 + 4  # comment
: syntax error: invalid arithmetic operator (error token is "# comment
")
osh46 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_ALT46 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)
dash47 Can't add integer to indexed array

stdout:
stderr: 
dash: 1: Syntax error: "(" unexpected
bash47 Can't add integer to indexed array

stdout:
6
stderr:
dash48 Can't add integer to associative array

stdout:
5
stderr:
dash: 1: typeset: not found
dash: 2: assoc[0]=42: not found
bash48 Can't add integer to associative array

stdout:
47
stderr:
mksh48 Can't add integer to associative array

stdout:
47
stderr:
mksh: <stdin>[1]: typeset: -A: unknown option
zsh48 Can't add integer to associative array

stdout:
47
stderr:
dash49 Double subscript

stdout:
stderr: 
dash: 1: Syntax error: "(" unexpected
zsh49 Double subscript

stdout:
1
stderr:
zsh: bad base syntax
osh49 Double subscript

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

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

stdout:
stderr: 
dash: 1: Syntax error: "(" unexpected
bash50 result of ArithSub is array

stdout:
declared
4
stderr:
mksh50 result of ArithSub is array

stdout:
declared
4
stderr:
dash51 result of ArithSub is assoc array

stdout:
stderr: 
dash: 1: Syntax error: "(" unexpected
bash51 result of ArithSub is assoc array

stdout:
declared
0
stderr:
mksh51 result of ArithSub is assoc array

stdout:
stderr: 
mksh: <stdin>[1]: syntax error: '(' unexpected
zsh51 result of ArithSub is assoc array

stdout:
declared
0
stderr:
zsh: no matches found: [foo]=bar
dash52 comma operator

stdout:
stderr: 
dash: 1: Syntax error: "(" unexpected
bash52 comma operator

stdout:
42
last=6
stderr:
mksh52 comma operator

stdout:
42
last=6
stderr:
dash54 array assignment with dynamic array name

stdout:
stderr: 
dash: 1: shopt: not found
dash: 3: arithmetic expression: expecting EOF: " xbar[5] = 42 "
zsh54 array assignment with dynamic array name

stdout:
42
xbar[5]=
stderr:
zsh: command not found: shopt
dash55 unary assignment with dynamic var name

stdout:
stderr: 
dash: 1: shopt: not found
dash: 4: arithmetic expression: expecting primary: " xbar++ "
dash56 unary array assignment with dynamic var name

stdout:
stderr: 
dash: 1: shopt: not found
dash: 3: xbar[5]=42: not found
dash: 4: arithmetic expression: expecting EOF: " xbar[5]++ "
zsh56 unary array assignment with dynamic var name

stdout:
0
xbar[5]=42
stderr:
zsh: command not found: shopt
dash57 shopt -s eval_unsafe_arith

stdout:
stderr: 
dash: 1: shopt: not found
dash: 3: Illegal number: 1+2
mksh57 shopt -s eval_unsafe_arith

stdout:
6
true
status=0
stderr:
mksh: <stdin>[1]: shopt: not found
zsh60 1 ? a=1 : b=2 ( bug fix)

stdout:
stderr: 
zsh: bad math expression: ':' expected
dash61 Invalid constant

stdout:
0
status=0
status=2
stderr:
dash: 1: arithmetic expression: expecting EOF: "a + 42x"
dash: 5: shopt: not found
dash: 6: arithmetic expression: expecting EOF: "a + 42x"
bash61 Invalid constant

stdout:
0
status=0
status=1
status=1
stderr:
bash: a + 42x: value too great for base (error token is "42x")
bash: line 5: shopt: eval_unsafe_arith: invalid shell option name
bash: line 6: a + 42x: value too great for base (error token is "42x")