Results for arith.test.sh

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

Details on runs that didn't PASS

osh10 Invalid string to int

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

stdout:
5
stderr:
osh47 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-cpp47 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)
osh50 Double subscript

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

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