From: Jean Privat Date: Tue, 8 Dec 2015 17:34:17 +0000 (-0500) Subject: tests: update *init* related tests X-Git-Tag: v0.8~44^2 X-Git-Url: http://nitlanguage.org?hp=dfd65d97e8c71accd489ea95e274c052c97793fb tests: update *init* related tests Signed-off-by: Jean Privat --- diff --git a/tests/base_init_auto.nit b/tests/base_init_auto.nit index 963dc12..f82dfc9 100644 --- a/tests/base_init_auto.nit +++ b/tests/base_init_auto.nit @@ -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 diff --git a/tests/base_init_combine.nit b/tests/base_init_combine.nit index e30298fe..20d9609 100644 --- a/tests/base_init_combine.nit +++ b/tests/base_init_combine.nit @@ -41,8 +41,7 @@ class E super B var i: Int - init(i: Int) do - self.i = i + init do i.output end end diff --git a/tests/base_init_linext2.nit b/tests/base_init_linext2.nit index aa032c0..00ab7ef 100644 --- a/tests/base_init_linext2.nit +++ b/tests/base_init_linext2.nit @@ -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 diff --git a/tests/base_init_simple.nit b/tests/base_init_simple.nit index a5cdb89..d1f8f3f 100644 --- a/tests/base_init_simple.nit +++ b/tests/base_init_simple.nit @@ -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 diff --git a/tests/base_init_super_call2.nit b/tests/base_init_super_call2.nit index 1211acf..be64735 100644 --- a/tests/base_init_super_call2.nit +++ b/tests/base_init_super_call2.nit @@ -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 diff --git a/tests/sav/base_init_combine_alt1.res b/tests/sav/base_init_combine_alt1.res index d210e23..23bd9f9 100644 --- a/tests/sav/base_init_combine_alt1.res +++ b/tests/sav/base_init_combine_alt1.res @@ -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`. diff --git a/tests/sav/base_init_super_call.res b/tests/sav/base_init_super_call.res index 0f283aa..596139a 100644 --- a/tests/sav/base_init_super_call.res +++ b/tests/sav/base_init_super_call.res @@ -16,12 +16,9 @@ true 11 true 12 -12 -13 13 14 true 15 15 16 -16 diff --git a/tests/sav/base_init_super_call2_alt3.res b/tests/sav/base_init_super_call2_alt3.res index 8cdfe03..f52de9b 100644 --- a/tests/sav/base_init_super_call2_alt3.res +++ b/tests/sav/base_init_super_call2_alt3.res @@ -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. diff --git a/tests/sav/base_init_super_call2_alt6.res b/tests/sav/base_init_super_call2_alt6.res index a03aff9..3c79f1c 100644 --- a/tests/sav/base_init_super_call2_alt6.res +++ b/tests/sav/base_init_super_call2_alt6.res @@ -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. diff --git a/tests/sav/base_init_super_call3.res b/tests/sav/base_init_super_call3.res index aa7d0fd..34536f6 100644 --- a/tests/sav/base_init_super_call3.res +++ b/tests/sav/base_init_super_call3.res @@ -4,7 +4,6 @@ 31 30 41 -50 51 60 61 diff --git a/tests/sav/base_init_super_call_alt3.res b/tests/sav/base_init_super_call_alt3.res index 921fd8f..138108b 100644 --- a/tests/sav/base_init_super_call_alt3.res +++ b/tests/sav/base_init_super_call_alt3.res @@ -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 diff --git a/tests/sav/base_init_super_call_alt6.res b/tests/sav/base_init_super_call_alt6.res index 724de84..2863a59 100644 --- a/tests/sav/base_init_super_call_alt6.res +++ b/tests/sav/base_init_super_call_alt6.res @@ -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 diff --git a/tests/test_ffi_c_more_callbacks.nit b/tests/test_ffi_c_more_callbacks.nit index 1b927aa..9c1e991 100644 --- a/tests/test_ffi_c_more_callbacks.nit +++ b/tests/test_ffi_c_more_callbacks.nit @@ -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 diff --git a/tests/test_multi_init.nit b/tests/test_multi_init.nit index d818431..63c62d7 100644 --- a/tests/test_multi_init.nit +++ b/tests/test_multi_init.nit @@ -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