From 6c8fde8f6821d89c93265ff74e9b21b410d6cd0b Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Sat, 27 Sep 2014 04:23:21 -0400 Subject: [PATCH] tests: update related to the init changes Signed-off-by: Jean Privat --- tests/example_objet.nit | 4 ++-- tests/example_point.nit | 9 ++------- tests/sav/base_init_combine_alt1.res | 10 +++++++++- tests/sav/error_init_auto_alt4.res | 6 +++--- tests/test_create.nit | 2 +- tests/test_create_more.nit | 4 ++-- 6 files changed, 19 insertions(+), 16 deletions(-) diff --git a/tests/example_objet.nit b/tests/example_objet.nit index 891a3d9..7473896 100644 --- a/tests/example_objet.nit +++ b/tests/example_objet.nit @@ -62,8 +62,8 @@ private # receveur ("self") # Les attributs sont déclarés par le mot clé "fun" et commencent par un "@" - var nom_: String # Un entrepôt a un nom (de type chaîne). - var rayons: Array[Rayon] # Il est composé d'un ensemble de rayon. + var nom_: String is noinit # Un entrepôt a un nom (de type chaîne). + var rayons: Array[Rayon] is noinit # Il est composé d'un ensemble de rayon. # "Array" est une classe paramétrée, les crochets en sont la marque. # La classe "Rayon" est définie plus loin diff --git a/tests/example_point.nit b/tests/example_point.nit index 2ad57c5..a7b89ea 100644 --- a/tests/example_point.nit +++ b/tests/example_point.nit @@ -16,8 +16,8 @@ class Point private - var x: Int # Abscisse - var y: Int # Ordonnée + var x: Int = 0 # Abscisse + var y: Int = 0 # Ordonnée # Change la position d'un point fun moveto(x: Int, y: Int) @@ -38,11 +38,6 @@ private end - init - do - moveto(0, 0) - end - init at(x: Int, y: Int) do moveto(x, y) diff --git a/tests/sav/base_init_combine_alt1.res b/tests/sav/base_init_combine_alt1.res index 5759dba..510c2f5 100644 --- a/tests/sav/base_init_combine_alt1.res +++ b/tests/sav/base_init_combine_alt1.res @@ -1 +1,9 @@ -alt/base_init_combine_alt1.nit:52,6: Error: base_init_combine_alt1#F cannot inherit constructors from E because there is attributes without initial values: z: Int +1 +2 +2 +3 +2 +2 +5 +2 +6 diff --git a/tests/sav/error_init_auto_alt4.res b/tests/sav/error_init_auto_alt4.res index 0bb1a5e..65c6fb1 100644 --- a/tests/sav/error_init_auto_alt4.res +++ b/tests/sav/error_init_auto_alt4.res @@ -1,3 +1,3 @@ -alt/error_init_auto_alt4.nit:35,5--12: Error: Incorrect number of parameters. Got 1, expected 0. Signature is -alt/error_init_auto_alt4.nit:36,5--15: Error: Incorrect number of parameters. Got 2, expected 0. Signature is -alt/error_init_auto_alt4.nit:37,5--18: Error: Incorrect number of parameters. Got 3, expected 0. Signature is +alt/error_init_auto_alt4.nit:34,5--9: Error: Incorrect number of parameters. Got 0, expected 1. Signature is (x: Int) +alt/error_init_auto_alt4.nit:36,5--15: Error: Incorrect number of parameters. Got 2, expected 1. Signature is (x: Int) +alt/error_init_auto_alt4.nit:37,5--18: Error: Incorrect number of parameters. Got 3, expected 1. Signature is (x: Int) diff --git a/tests/test_create.nit b/tests/test_create.nit index c41c81a..0eee185 100644 --- a/tests/test_create.nit +++ b/tests/test_create.nit @@ -24,7 +24,7 @@ redef class Object end class Toto - var a: Int + var a: Int is noinit redef fun output do printn(_a) diff --git a/tests/test_create_more.nit b/tests/test_create_more.nit index 844ffee..d870cea 100644 --- a/tests/test_create_more.nit +++ b/tests/test_create_more.nit @@ -15,8 +15,8 @@ # limitations under the License. class A - var attribute: nullable A - var num: Char + var attribute: nullable A is noinit + var num: Char is noinit fun foo=(a: nullable A) do -- 1.7.9.5