blob: 2f68f7698e90ef4e410aa9556dcee41532b63b28 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# file : tests/eval/comp.testscript
# license : MIT; see accompanying LICENSE file
# Test comparison operators (eval-comp).
.include ../common.testscript
$* <'print (foo == bar)' >'false' : eq-false
$* <'print (foo == foo)' >'true' : eq-true
$* <'print (foo != foo)' >'false' : ne-false
$* <'print (foo != bar)' >'true' : ne-true
$* <'print (foo < bar)' >'false' : lt-false
$* <'print (bar < foo)' >'true' : lt-true
$* <'print (bar > foo)' >'false' : gt-false
$* <'print (foo > bar)' >'true' : gt-true
$* <'print (foo <= bar)' >'false' : le-false
$* <'print (bar <= foo)' >'true' : le-true
$* <'print (bar <= bar)' >'true' : le-true-eq
$* <'print (bar >= foo)' >'false' : ge-false
$* <'print (foo >= bar)' >'true' : ge-true
$* <'print (foo >= foo)' >'true' : ge-true-eq
: associativity
:
$* <'print (foo == bar == false)' >'true'
: type
:
{
$* <'print ((foo bar) == foo bar)' >'true' : untyped-list
$* <'print ("" == "")' >'true' : untyped-empty
$* <'print (0 < 00)' >'true' : untyped-untyped
$* <'print (0 < [null])' >'false' : untyped-null
$* <'print ([uint64] 00 < 0)' >'false' : uint64-untyped
$* <'print ([uint64] 00 < [null])' >'false' : uint64-null
$* <'print ([uint64] 00 < [uint64] 0)' >'false' : uint64-uint64
$* <'print ([uint64] 00 < [string] 0)' 2>>EOE != 0 : uint64-string
<stdin>:1:20: error: comparison between uint64 and string
EOE
}
|