Results for arith.test.sh

statusoshosh-cpp
pass 7171
ok 33
total7474
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
18pass pass Increment undefined variables
19pass pass Increment and decrement array elements
20pass pass Increment undefined variables with nounset
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 Hex constant with capital X
38pass pass Dynamic var names - result of runtime parse/eval
39pass pass Recursive name evaluation is a result of runtime parse/eval
40pass pass nounset with arithmetic
41pass pass 64-bit integer doesn't overflow
42pass pass More 64-bit ops
43pass pass Invalid LValue
44pass pass Invalid LValue that looks like array
45pass pass Invalid LValue: two sets of brackets
46pass pass Operator Precedence
47pass pass Exponentiation with **
48pass pass Exponentiation operator has buggy precedence
49pass pass Negative exponent
50ok ok Comment not allowed in the middle of multiline arithmetic
detailsdetails
51pass pass Add integer to indexed array (a[0] decay)
52pass pass Add integer to associative array (a[0] decay)
53ok ok Double subscript
detailsdetails
54pass pass result of ArithSub -- array[0] decay
55pass pass result of ArithSub -- assoc[0] decay
56pass pass comma operator
57pass pass assignment with dynamic var name
58pass pass array assignment with dynamic array name
59pass pass unary assignment with dynamic var name
60pass pass unary array assignment with dynamic var name
61pass pass Dynamic parsing of arithmetic
62pass pass Dynamic parsing on empty string
63pass pass nested ternary (bug fix)
64pass pass 1 ? a=1 : b=2 ( bug fix)
65pass pass Invalid constant
66pass pass Negative numbers with integer division /
67pass pass Negative numbers with %
68pass pass Negative numbers with bit shift
69pass pass undef[0]
70pass pass undef[0] with nounset
71pass pass s[0] with string abc
72pass pass s[0] with string 42
73pass pass s[0] with string '12 34'
142 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:
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)
osh-cpp50 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)
osh53 Double subscript

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

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