Results for ysh-expr-compare.test.sh

statusosh
pass 12
FAIL 5
total17
caseoshdescription
0pass Exact equality with === and !==
1FAIL Approximate equality of Str x {Str, Int, Bool} with ~==
details
2pass Wrong Types with ~==
3pass === on float not allowed
4pass floatsEqual()
5FAIL Comparison converts from Str -> Int or Float
details
6pass Comparison of Int
7FAIL Comparison of Str does conversion to Int
details
8FAIL Mixed Type Comparison does conversion to Int
details
9FAIL Invalid String is an error
details
10pass Bool conversion -- explicit allowed, implicit not allowed
11pass Chained Comparisons
12pass List / "Tuple" comparison is not allowed
13pass Ternary op behaves like if statement
14pass Undefined comparisons
15pass Non-comparable types in case arms
16pass object identity
12 passed, 0 OK, 0 not implemented, 0 BUG, 5 failed, 0 timeouts, 0 cases skipped
5 failed under osh

Details on runs that didn't PASS

osh1 Approximate equality of Str x {Str, Int, Bool} with ~==

[osh stdout] Expected 'Str-Str\nStr-Int\nStr-Negative\nStr-Underscore\nStr-Bool\nbool matrix\n' Got 'Str-Str\n'
[osh status] Expected 0, got 1

stdout:
Str-Str
stderr:
  if ('3 ' ~== 3) {
           ^~~
[ stdin ]:11: fatal: Integer too big
osh5 Comparison converts from Str -> Int or Float

[osh stdout] Expected ' i i true\nsi i true\n i si true\n---\n f f true\nsf f true\n f sf true\n---\n i f false\nsi f false\n i sf false\n---\n f i true\nsf i true\n f si true\n' Got ' i i true\n'
[osh status] Expected 0, got 1

stdout:
 i  i true
stderr:
  echo 'si  i' $['1' < 2]
               ^~
[ stdin ]:2: fatal: Integer too big: 1
osh7 Comparison of Str does conversion to Int

[osh stdout] Expected '<\n<=\n>\n>=\n', got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
  if ('2' < '11') {
  ^~
[ stdin ]:3: fatal: Integer too big: 2
osh8 Mixed Type Comparison does conversion to Int

[osh stdout] Expected '<\n<=\n>\n>=\n', got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
  if (2 < '11') {
  ^~
[ stdin ]:3: fatal: Integer too big: 11
osh9 Invalid String is an error

[osh status] Expected 3, got 1

stdout:
stderr: 
    = '3' < 'bar'
    ^
[ stdin ]:4: fatal: Integer too big: 3