update NOTICE and LICENSE
[nit.git] / tests / base_primitive_null.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Copyright 2009 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 class A
20 var _i: nullable Int = null
21 var _b: nullable Bool = null
22 var _c: nullable Char = null
23
24 init
25 do
26 var o: nullable Object
27 'I'.output
28 '\n'.output
29 (_i == null).output
30 (not _i == 0).output
31 o = _i
32 (o == null).output
33 (not o == 0).output
34 #alt1#_i.output
35
36 'B'.output
37 '\n'.output
38 (_b == null).output
39 (not _b == false).output
40 o = _b
41 (o == null).output
42 (not o == false).output
43 #alt2#_b.output
44
45 'C'.output
46 '\n'.output
47 (_c == null).output
48 (not _c == '\0').output
49 o = _c
50 (o == null).output
51 (not o == '\0').output
52 #alt3#_c.ascii.output
53 end
54 end
55
56 var a = new A