Results for ysh-expr.test.sh

statusosh
pass 22
FAIL 9
total31
caseoshdescription
0pass command sub $(echo hi)
1pass Set $HOME using 'var' (i.e. YSH string var in word evaluator)
2pass Use shell var in YSH expression
3FAIL Length doesn't apply to BashArray
details
4FAIL $[len(x)] inside strings
details
5pass Func with multiple args in multiple contexts
6pass Trailing Comma in Param list
7FAIL nested expr contexts
details
8pass YSH var used with shell arithmetic
9pass Parse { var x = 42 }
10pass double quoted
11pass double quoted respects strict_array
12pass simple var sub $name $0 $1 $? etc.
13pass braced var sub ${x:-default}
14pass braced var sub respects strict_array
15pass null / true / false
16FAIL multiline dict
details
17FAIL multiline array and command sub (only here docs disallowed)
details
18pass obj=>method() - remove?
19pass s->upper does NOT work, should be s.upper() or =>
20pass d.key
21FAIL a ++ b for string/list concatenation
details
22pass s ~~ glob and s !~~ glob
23pass Type Errors
24pass can't use ++ on integers
25pass can't do mystr ++ mylist
26FAIL expression literals
details
27pass No list comprehension in ^[]
28pass expression literals, evaluation failure
29FAIL expression literals, lazy evaluation
details
30FAIL expression literals, sugar for strings
details
22 passed, 0 OK, 0 not implemented, 0 BUG, 9 failed, 0 timeouts, 0 cases skipped
9 failed under osh

Details on runs that didn't PASS

osh3 Length doesn't apply to BashArray

[osh status] Expected 3 Got 2

stdout:
shell=5
stderr:
  echo ysh=$[len(x)]
                ^
[ stdin ]:7: Unexpected token after arithmetic expression (Id.Arith_LParen != Id.Arith_RBracket)
osh4 $[len(x)] inside strings

[osh stdout] Expected '-3-\n' Got ''
[osh status] Expected 0 Got 2

stdout:
stderr: 
  echo -$[len(s)]-
             ^
[ stdin ]:2: Unexpected token after arithmetic expression (Id.Arith_LParen != Id.Arith_RBracket)
osh7 nested expr contexts

[osh stdout] Expected 'len 3\n' Got ''
[osh status] Expected 0 Got 2

stdout:
stderr: 
  var x = $(echo $'len\n' $[len(s)])
                               ^
[ stdin ]:3: Unexpected token after arithmetic expression (Id.Arith_LParen != Id.Arith_RBracket)
osh16 multiline dict

[osh stdout] Expected 'mydict=2\n' Got ''
[osh status] Expected 0 Got 2

stdout:
stderr: 
  echo mydict=$[len(mydict)]
                   ^
[ stdin ]:4: Unexpected token after arithmetic expression (Id.Arith_LParen != Id.Arith_RBracket)
osh17 multiline array and command sub (only here docs disallowed)

[osh stdout] Expected 'array=3\ncomsub=6\n' Got ''
[osh status] Expected 0 Got 2

stdout:
stderr: 
  echo array=$[len(array)]
                  ^
[ stdin ]:6: Unexpected token after arithmetic expression (Id.Arith_LParen != Id.Arith_RBracket)
osh21 a ++ b for string/list concatenation

[osh stdout] Expected 'string abcde\nlist len=3\n---\nStr Int 3\nList Int 3\nInt Str 3\n' Got 'string abcde\n'
[osh status] Expected 0 Got 2

stdout:
string abcde
stderr:
  echo list len=$[len(c)]
                     ^
[ stdin ]:12: Unexpected token after arithmetic expression (Id.Arith_LParen != Id.Arith_RBracket)
osh26 expression literals

[osh stdout] Expected 'type=Expr\n3\nfalse\ntrue\n(List) [3,4]\n' Got ''
[osh status] Expected 0 Got 2

stdout:
stderr: 
  echo type=$[type(e)]
                  ^
[ stdin ]:3: Unexpected token after arithmetic expression (Id.Arith_LParen != Id.Arith_RBracket)
osh29 expression literals, lazy evaluation

[osh stdout] Expected 'result=1\n' Got ''
[osh status] Expected 0 Got 2

stdout:
stderr: 
  echo result=$[io->evalExpr(e)]
                   ^
[ stdin ]:5: Token can't be used in prefix position
osh30 expression literals, sugar for strings

[osh stdout] Expected 'result=x is 1\n' Got ''
[osh status] Expected 0 Got 2

stdout:
stderr: 
  echo result=$[io->evalExpr(e)]
                   ^
[ stdin ]:5: Token can't be used in prefix position