Results for arith.test.sh

statusbashdashmkshzshosh
pass 6329524571
ok 78593
N-I 234880
BUG 239120
total7474747474
casebashdashmkshzshoshdescription
0pass N-I 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 ok N-I N-I pass Invalid string to int with strict_arith
detailsdetailsdetailsdetails
12pass N-I BUG BUG pass Integer constant parsing
detailsdetailsdetails
13pass ok BUG BUG pass Integer constant validation
detailsdetailsdetails
14pass pass pass pass pass Newline in the middle of expression
15pass pass pass pass pass Ternary operator
16pass N-I pass pass pass Preincrement
details
17pass N-I pass pass pass Postincrement
details
18pass N-I pass pass pass Increment undefined variables
details
19pass N-I pass BUG pass Increment and decrement array elements
detailsdetails
20pass ok BUG BUG pass Increment undefined variables with nounset
detailsdetailsdetails
21pass N-I pass pass pass Comma operator (borrowed from C)
details
22pass pass pass pass pass Augmented assignment
23pass pass pass pass pass Comparison Ops
24pass pass pass pass pass Logical Ops
25pass N-I pass pass pass Logical Ops Short Circuit
details
26pass pass pass pass pass Bitwise ops
27pass pass pass pass pass Unary minus and plus
28ok pass ok BUG pass No floating point
detailsdetailsdetails
29pass N-I pass ok pass Array indexing in arith
detailsdetails
30pass N-I pass pass pass Constants in base 36
details
31pass N-I N-I N-I pass Constants in bases 2 to 64
detailsdetailsdetails
32pass N-I pass pass pass Multiple digit constants with base N
details
33pass N-I pass pass pass Dynamic base constants
details
34pass pass N-I N-I pass Octal constant
detailsdetails
35pass pass N-I N-I pass Dynamic octal constant
detailsdetails
36pass pass pass pass pass Dynamic hex constants
37pass pass pass pass pass Hex constant with capital X
38pass pass pass pass pass Dynamic var names - result of runtime parse/eval
39pass N-I pass pass pass Recursive name evaluation is a result of runtime parse/eval
details
40pass BUG BUG BUG pass nounset with arithmetic
detailsdetailsdetails
41pass pass BUG pass pass 64-bit integer doesn't overflow
details
42pass N-I BUG pass pass More 64-bit ops
detailsdetails
43ok N-I ok ok pass Invalid LValue
detailsdetailsdetailsdetails
44ok N-I ok ok pass Invalid LValue that looks like array
detailsdetailsdetailsdetails
45ok N-I ok ok pass Invalid LValue: two sets of brackets
detailsdetailsdetailsdetails
46pass pass pass pass pass Operator Precedence
47pass N-I N-I pass pass Exponentiation with **
detailsdetails
48pass N-I N-I pass pass Exponentiation operator has buggy precedence
detailsdetails
49pass N-I pass ok pass Negative exponent
detailsdetails
50ok ok pass pass ok Comment not allowed in the middle of multiline arithmetic
detailsdetailsdetails
51pass N-I N-I N-I pass Add integer to indexed array (a[0] decay)
detailsdetailsdetails
52pass BUG pass pass pass Add integer to associative array (a[0] decay)
details
53pass N-I pass ok ok Double subscript
detailsdetailsdetails
54pass N-I pass N-I pass result of ArithSub -- array[0] decay
detailsdetails
55pass N-I N-I pass pass result of ArithSub -- assoc[0] decay
detailsdetails
56pass N-I pass N-I pass comma operator
detailsdetails
57pass pass pass pass pass assignment with dynamic var name
58pass N-I pass BUG pass array assignment with dynamic array name
detailsdetails
59pass BUG pass pass pass unary assignment with dynamic var name
details
60pass N-I pass BUG pass unary array assignment with dynamic var name
detailsdetails
61pass N-I BUG pass pass Dynamic parsing of arithmetic
detailsdetails
62pass pass pass pass pass Dynamic parsing on empty string
63pass pass pass pass pass nested ternary (bug fix)
64pass pass pass BUG pass 1 ? a=1 : b=2 ( bug fix)
details
65BUG ok pass pass pass Invalid constant
detailsdetails
66pass pass pass pass pass Negative numbers with integer division /
67pass pass pass pass pass Negative numbers with %
68ok ok BUG ok pass Negative numbers with bit shift
detailsdetailsdetailsdetails
69pass N-I pass pass pass undef[0]
details
70pass N-I BUG BUG pass undef[0] with nounset
detailsdetailsdetails
71pass N-I pass pass pass s[0] with string abc
details
72pass N-I pass BUG pass s[0] with string 42
detailsdetails
73BUG ok pass BUG pass s[0] with string '12 34'
detailsdetailsdetails
260 passed, 32 OK, 52 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:
bash7 Constant with quotes like '1'

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

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

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

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

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

stdout:
foo
stderr:
dash: 1: shopt: not found
dash: 4: Illegal number: foo
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
dash12 Integer constant parsing

stdout:
298
10
511
8
stderr:
dash: 5: arithmetic expression: expecting EOF: " 24#ag7 "
mksh12 Integer constant parsing

stdout:
298
10
777
10
6151
stderr:
zsh12 Integer constant parsing

stdout:
298
10
777
10
6151
stderr:
dash13 Integer constant validation

stdout:
status=2
status=2
status=2
status=2
stderr:
dash: 1: shopt: not found
dash: 1: arithmetic expression: expecting EOF: " 0x1X "
dash: 1: shopt: not found
dash: 1: arithmetic expression: expecting EOF: " 09 "
dash: 1: shopt: not found
dash: 1: arithmetic expression: expecting EOF: " 2#A "
dash: 1: shopt: not found
dash: 1: arithmetic expression: expecting EOF: " 02#0110 "
mksh13 Integer constant validation

stdout:
status=1
9
status=0
status=1
6
status=0
stderr:
mksh: shopt: not found
mksh:  0x1X : bad number '0x1X'
mksh: shopt: not found
mksh: shopt: not found
mksh:  2#A : bad number '2#A'
mksh: shopt: not found
zsh13 Integer constant validation

stdout:
status=1
9
status=0
status=1
6
status=0
stderr:
zsh:1: command not found: shopt
zsh:1: bad math expression: operator expected at `X '
zsh:1: command not found: shopt
zsh:1: command not found: shopt
zsh:1: bad math expression: operator expected at `A '
zsh:1: command not found: shopt
dash16 Preincrement

stdout:
4
4
stderr:
dash17 Postincrement

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

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

stdout:
stderr: 
dash: 1: shopt: not found
dash: 2: Syntax error: "(" unexpected
zsh19 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
dash20 Increment undefined variables with nounset

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

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

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

stdout:
stderr: 
dash: 3: arithmetic expression: expecting EOF: "a,(b+1)"
dash25 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
bash28 No floating point

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

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

stdout:
3.2999999999999998
stderr:
dash29 Array indexing in arith

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

stdout:
7
stderr:
dash30 Constants in base 36

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

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

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

stdout:
stderr: 
zsh: invalid base (must be 2 to 36 inclusive): 64
dash32 Multiple digit constants with base N

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

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

stdout:
11
stderr:
zsh34 Octal constant

stdout:
11
stderr:
mksh35 Dynamic octal constant

stdout:
11
stderr:
zsh35 Dynamic octal constant

stdout:
11
stderr:
dash39 Recursive name evaluation is a result of runtime parse/eval

stdout:
stderr: 
dash: 5: Illegal number: foo
dash40 nounset with arithmetic

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

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

stdout:
should not get here: x=5
stderr:
mksh41 64-bit integer doesn't overflow

stdout:
-2147483648
0
-2147483648
max positive = 2147483647
stderr:
dash42 More 64-bit ops

stdout:
stderr: 
mksh42 More 64-bit ops

stdout:
eq=1
eq=0
greater=1
greater=1
ge=1
ge=0
le=0
le=0
stderr:
bash43 Invalid LValue

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

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

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

stdout:
9
stderr:
zsh: bad math expression: lvalue required
bash44 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 ")
dash44 Invalid LValue that looks like array

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

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

stdout:
status=2
stderr:
zsh: bad base syntax
bash45 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 ")
dash45 Invalid LValue: two sets of brackets

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

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

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

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

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

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

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

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

stdout:
2.5
stderr:
bash50 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
")
dash50 Comment not allowed in the middle of multiline arithmetic

stdout:
6
stderr:
dash: 6: arithmetic expression: expecting EOF: "
1 + 2  # not a comment
"
osh50 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)
dash51 Add integer to indexed array (a[0] decay)

stdout:
stderr: 
dash: 1: Syntax error: "(" unexpected
mksh51 Add integer to indexed array (a[0] decay)

stdout:
stderr: 
mksh: <stdin>[1]: syntax error: '(' unexpected
zsh51 Add integer to indexed array (a[0] decay)

stdout:
stderr: 
zsh: bad math expression: operator expected at `2 3'
dash52 Add integer to associative array (a[0] decay)

stdout:
5
stderr:
dash: 1: typeset: not found
dash: 2: assoc[0]=42: not found
dash53 Double subscript

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

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

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

stdout:
stderr: 
dash: 1: Syntax error: "(" unexpected
zsh54 result of ArithSub -- array[0] decay

stdout:
declared
stderr:
zsh: bad math expression: operator expected at `5 6'
dash55 result of ArithSub -- assoc[0] decay

stdout:
stderr: 
dash: 1: Syntax error: "(" unexpected
mksh55 result of ArithSub -- assoc[0] decay

stdout:
stderr: 
mksh: <stdin>[1]: syntax error: '(' unexpected
dash56 comma operator

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

stdout:
stderr: 
zsh: bad math expression: operator expected at `5 6'
dash58 array assignment with dynamic array name

stdout:
stderr: 
dash: 2: arithmetic expression: expecting EOF: " xbar[5] = 42 "
zsh58 array assignment with dynamic array name

stdout:
42
xbar[5]=
stderr:
dash59 unary assignment with dynamic var name

stdout:
stderr: 
dash: 3: arithmetic expression: expecting primary: " xbar++ "
dash60 unary array assignment with dynamic var name

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

stdout:
0
xbar[5]=42
stderr:
dash61 Dynamic parsing of arithmetic

stdout:
stderr: 
dash: 2: Illegal number: 1+2
mksh61 Dynamic parsing of arithmetic

stdout:
6
true
status=0
stderr:
zsh64 1 ? a=1 : b=2 ( bug fix)

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

stdout:
0
status=0
status=1
status=1
stderr:
bash: line 1: a + 42x: value too great for base (error token is "42x")
bash: line 7: a + 42x: value too great for base (error token is "42x")
dash65 Invalid constant

stdout:
0
status=0
status=2
stderr:
dash: 1: arithmetic expression: expecting EOF: "a + 42x"
dash: 7: arithmetic expression: expecting EOF: "a + 42x"
bash68 Negative numbers with bit shift

stdout:
10
5
-9223372036854775808
---
8
16
0
0
---
stderr:
dash68 Negative numbers with bit shift

stdout:
10
5
-9223372036854775808
---
8
16
0
0
---
stderr:
mksh68 Negative numbers with bit shift

stdout:
10
5
-2147483648
---
8
16
0
0
---
stderr:
zsh68 Negative numbers with bit shift

stdout:
10
5
-9223372036854775808
---
8
16
0
0
---
stderr:
dash69 undef[0]

stdout:
stderr: 
dash70 undef[0] with nounset

stdout:
stderr: 
mksh70 undef[0] with nounset

stdout:
UNSET 0
status=0
stderr:
zsh70 undef[0] with nounset

stdout:
UNSET 0
status=0
stderr:
dash71 s[0] with string abc

stdout:
stderr: 
dash72 s[0] with string 42

stdout:
stderr: 
zsh72 s[0] with string 42

stdout:
42 0 4
status=0
stderr:
bash73 s[0] with string '12 34'

stdout:
status=1
stderr:
bash: line 2: 12 34: syntax error in expression (error token is "34")
dash73 s[0] with string '12 34'

stdout:
stderr: 
dash: 2: Illegal number: 12 34
zsh73 s[0] with string '12 34'

stdout:
12 34 0 1
status=0
stderr: