Merge: doc: fixed some typos and other misc. corrections
[nit.git] / tests / base_isa3.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Copyright 2012 Alexandre Terrasa <alexandre@moz-code.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 base_minimal
18
19 class A end
20
21 class B
22 super A
23 end
24
25 class C
26 super A
27 end
28
29 class E
30 super A
31 end
32
33 class G
34 super A
35 end
36
37 class D
38 super C
39 super E
40 end
41
42 class F
43 super E
44 super G
45 end
46
47 var a = new A
48 var b = new B
49 var c = new C
50 var d = new D
51 var e = new E
52 var f = new F
53 var g = new G
54
55 # A
56 assert not a isa B
57
58 # B
59 assert b isa A
60 assert b isa B
61 assert not b isa C
62
63 # C
64 assert c isa A
65 assert not c isa B
66 assert c isa C
67
68 # D
69 assert d isa A
70 assert not d isa B
71 assert d isa C
72 assert d isa D
73 assert d isa E
74 assert d isa E
75 assert d isa E
76 assert d isa E
77
78 # E
79 assert e isa A
80 assert not e isa B
81 assert e isa E
82
83 # F
84 assert f isa A
85 assert f isa E
86 assert f isa F
87 assert f isa G
88 assert not f isa D
89
90 # G
91 assert g isa A
92 assert not g isa B
93 assert g isa G
94
95 true.output