First NIT release and new clean mercurial repository
[nit.git] / tests / base_eq_int2.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Copyright 2006-2008 Jean Privat <jean@pryen.org>
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16
17 import kernel
18
19 var a = 5
20 var b = 5
21 var c: Object = 5
22 var d: Object = 6
23 var e: Object = 5.0
24
25 a.is_same_type(5).output
26 a.is_same_type(a).output
27 a.is_same_type(b).output
28 a.is_same_type(c).output
29 a.is_same_type(d).output
30 (not a.is_same_type(e)).output
31
32 '\n'.output
33
34 c.is_same_type(5).output
35 c.is_same_type(a).output
36 c.is_same_type(b).output
37 c.is_same_type(c).output
38 c.is_same_type(d).output
39 (not c.is_same_type(e)).output
40
41 '\n'.output
42
43 (not 1.0.is_same_type(5)).output
44 (not 1.0.is_same_type(a)).output
45 (not 1.0.is_same_type(b)).output
46 (not 1.0.is_same_type(c)).output
47 (not 1.0.is_same_type(d)).output
48 1.0.is_same_type(e).output
49
50 '\n'.output
51 '\n'.output
52
53
54 (5 == 5).output
55 (5 != 5.0).output
56 (5.0 == 5.0).output
57 (5.0 != 5).output
58 (not 6 == 5).output
59 (not 6 == 5.0).output
60 (not 6.0 == 5.0).output
61 (not 6.0 == 5).output
62
63 '\n'.output
64
65 (a == 5).output
66 (not a == 6).output
67 (a == a).output
68 (a == b).output
69 (a == c).output
70 (not a == d).output
71 (not a == e).output
72
73 '\n'.output
74
75 (a == 5).output
76 (not a == 6).output
77 (a == a).output
78 (a == b).output
79 (a == c).output
80 (not a == d).output
81 (a != e).output
82
83 '\n'.output
84
85 (c == 5).output
86 (not c == 6).output
87 (c == a).output
88 (c == b).output
89 (c == c).output
90 (not c == d).output
91 (not c == e).output
92
93 '\n'.output
94
95 (c == 5).output
96 (not c == 6).output
97 (c == a).output
98 (c == b).output
99 (c == c).output
100 (not c == d).output
101 (c != e).output
102