tests: update *init* related tests
authorJean Privat <jean@pryen.org>
Tue, 8 Dec 2015 17:34:17 +0000 (12:34 -0500)
committerJean Privat <jean@pryen.org>
Tue, 8 Dec 2015 19:33:44 +0000 (14:33 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

14 files changed:
tests/base_init_auto.nit
tests/base_init_combine.nit
tests/base_init_linext2.nit
tests/base_init_simple.nit
tests/base_init_super_call2.nit
tests/sav/base_init_combine_alt1.res
tests/sav/base_init_super_call.res
tests/sav/base_init_super_call2_alt3.res
tests/sav/base_init_super_call2_alt6.res
tests/sav/base_init_super_call3.res
tests/sav/base_init_super_call_alt3.res
tests/sav/base_init_super_call_alt6.res
tests/test_ffi_c_more_callbacks.nit
tests/test_multi_init.nit

index 963dc12..f82dfc9 100644 (file)
@@ -22,7 +22,7 @@ class A
        var y: Int = -2 #alt2#
        #alt2#var y: Int
        #alt3#init (xx: Int) do x = xx
-       #alt4#init foo(xx: Int) do x = xx
+       #alt4#init foo(xx: Int) do init(xx)
        fun work
        do
                x.output
index e30298f..20d9609 100644 (file)
@@ -41,8 +41,7 @@ class E
        super B
 
        var i: Int
-       init(i: Int) do
-               self.i = i
+       init do
                i.output
        end
 end
index aa032c0..00ab7ef 100644 (file)
@@ -73,14 +73,14 @@ class C
                '2'.output
                ' '.output
        end
-       init init_par(c: Char)
+       redef init init_par(c: Char)
        do
                'C'.output
                '3'.output
                c.output
                ' '.output
        end
-       init init_par3(c: Char)
+       redef init init_par3(c: Char)
        do
                'C'.output
                '4'.output
index a5cdb89..d1f8f3f 100644 (file)
@@ -11,7 +11,7 @@ class B
        #alt1#redef init do '1'.output
        init do '1'.output #alt1#
        #alt1#redef init init2 do '2'.output
-       init init2 do '2'.output #alt1#
+       redef init init2 do '2'.output #alt1#
        #alt1#redef init init3 do '3'.output
        init init3 do '3'.output #alt1#
 end
index 1211acf..be64735 100644 (file)
@@ -89,6 +89,7 @@ end
 class C3
        super A
        init(j: Int) do
+               super(j)#alt6#
                j.output
        end
 end
@@ -96,6 +97,7 @@ end
 class D3
        super A
        init(j: Int) do
+               super(j)#alt6#
                j.output
        end
 end
@@ -119,6 +121,7 @@ end
 class F2
        super A
        init(j: Int, k: Bool) do
+               super(j)#alt6#
                j.output
        end
 end
index d210e23..23bd9f9 100644 (file)
@@ -1,13 +1 @@
-1
-2
-1
-2
-3
-1
-2
-1
-2
-5
-1
-2
-6
+alt/base_init_combine_alt1.nit:59,9--11: Error: expected 2 argument(s) for `init(i: Int, z: Int)`; got 1. See introduction at `core::Object::init`.
index 0f283aa..596139a 100644 (file)
@@ -16,12 +16,9 @@ true
 11
 true
 12
-12
-13
 13
 14
 true
 15
 15
 16
-16
index 8cdfe03..f52de9b 100644 (file)
@@ -1 +1 @@
-alt/base_init_super_call2_alt3.nit:38,2--5: Error: cannot do an implicit constructor call to `base_init_super_call2_alt3#A#init(i: Int)`. Expected at least `1` arguments, got `0`.
+alt/base_init_super_call2_alt3.nit:38,2--5: Error: cannot do an implicit constructor call to `base_init_super_call2_alt3#A#init(i: Int)`. Expected at least `1` arguments.
index a03aff9..3c79f1c 100644 (file)
@@ -1 +1,4 @@
-alt/base_init_super_call2_alt6.nit:105,2--5: Error: cannot do an implicit constructor call to `base_init_super_call2_alt6#A#init(i: Int)`. Expected argument #0 of type `Int`, got implicit argument `j` of type `Bool`.
+alt/base_init_super_call2_alt6.nit:91,2--5: Error: cannot do an implicit constructor call to `base_init_super_call2_alt6#A#init(i: Int)`. Expected at least `1` arguments.
+alt/base_init_super_call2_alt6.nit:99,2--5: Error: cannot do an implicit constructor call to `base_init_super_call2_alt6#A#init(i: Int)`. Expected at least `1` arguments.
+alt/base_init_super_call2_alt6.nit:107,2--5: Error: cannot do an implicit constructor call to `base_init_super_call2_alt6#A#init(i: Int)`. Expected at least `1` arguments.
+alt/base_init_super_call2_alt6.nit:123,2--5: Error: cannot do an implicit constructor call to `base_init_super_call2_alt6#A#init(i: Int)`. Expected at least `1` arguments.
index 921fd8f..138108b 100644 (file)
@@ -1 +1,23 @@
-alt/base_init_super_call_alt3.nit:38,2--5: Error: cannot do an implicit constructor call to `base_init_super_call_alt3#A#init(i: Int)`. Expected at least `1` arguments, got `0`.
+1
+2
+3
+4
+6
+6
+7
+7
+8
+true
+9
+9
+10
+10
+11
+true
+12
+13
+14
+true
+15
+15
+16
index 724de84..2863a59 100644 (file)
@@ -1 +1,23 @@
-alt/base_init_super_call_alt6.nit:105,2--5: Error: cannot do an implicit constructor call to `base_init_super_call_alt6#A#init(i: Int)`. Expected argument #0 of type `Int`, got implicit argument `j` of type `Bool`.
+1
+2
+3
+4
+5
+6
+6
+7
+7
+8
+true
+9
+9
+10
+10
+11
+true
+12
+13
+true
+15
+15
+16
index 1b927aa..9c1e991 100644 (file)
@@ -22,7 +22,7 @@ module test_ffi_c_more_callbacks
 `}
 
 class A
-       var a: Int
+       var a: Int is noautoinit
        init do a = 1234
        init alt(i: Int) do a = i
        fun to_i: Int do return a
index d818431..63c62d7 100644 (file)
@@ -1,12 +1,12 @@
 
 class A
        var s : String
-       init a( s : String ) do self.s = s
+       init a( s : String ) do init(s)
 end
 
 class B
        var i : Int
-       init b( i : Int ) do self.i = i
+       init b( i : Int ) do init(i)
 end
 
 class C