Results for arith.test.sh

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

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

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