tests: update tests related to default arguments
authorJean Privat <jean@pryen.org>
Thu, 6 Aug 2015 18:34:40 +0000 (14:34 -0400)
committerJean Privat <jean@pryen.org>
Mon, 10 Aug 2015 13:57:43 +0000 (09:57 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

16 files changed:
tests/base_arg_default.nit
tests/base_arg_default_autoinit.nit
tests/base_arg_named.nit
tests/base_arg_named_inherit.nit
tests/base_arg_order.nit
tests/sav/base_arg_default.res
tests/sav/base_arg_default_alt1.res
tests/sav/base_arg_default_autoinit.res
tests/sav/base_arg_default_autoinit_alt1.res
tests/sav/base_arg_named.res
tests/sav/base_arg_named_alt1.res
tests/sav/base_arg_named_inherit.res
tests/sav/base_arg_named_inherit_alt1.res
tests/sav/base_arg_named_inherit_alt2.res
tests/sav/base_arg_named_inherit_alt3.res [new file with mode: 0644]
tests/sav/base_arg_order.res

index 2d1af37..d4de4ed 100644 (file)
@@ -80,8 +80,8 @@ var x
 
 #alt1#a.foo
 #alt1#a.foo(2)
-a.foo(1,2)
-a.foo(1,2,3)
+#alt1#a.foo(1,2)
+#alt1#a.foo(1,2,3)
 a.foo(1,2,3,4)
 a.foo(1,2,3,4,5)
 a.foo(1,2,3,4,5,6)
index 6ea74cf..f5f4622 100644 (file)
@@ -71,11 +71,11 @@ a.foo
 #alt1#a = new B(1)
 #alt1#a.foo
 
-a = new B(1,4)
-a.foo
+#alt1#a = new B(1,4)
+#alt1#a.foo
 
-a = new B(1,2,4)
-a.foo
+#alt1#a = new B(1,2,4)
+#alt1#a.foo
 
 a = new B(1,2,3,4)
 a.foo
@@ -86,8 +86,8 @@ a.foo
 #alt1#a = new C(1)
 #alt1#a.foo
 
-a = new C(4,1)
-a.foo
+#alt1#a = new C(4,1)
+#alt1#a.foo
 
 a = new C(3,4,1)
 a.foo
index a584add..e82ca07 100644 (file)
 import base_arg_default
 
 var a = new A
+a.foo(a=1,b=2,c=3,d=4,e=5,f=6)
 a.foo(a=1,b=2,3,4,e=5,f=6)
 a.foo(f=6,3,e=5,b=2,4,a=1)
-a.foo(3,e=5,b=2,4)
+a.foo(f=6,d=4,e=5,b=2,c=3,a=1)
+#alt1#a.foo(3,e=5,b=2,4)
 
 a.bar
 
@@ -43,4 +45,3 @@ a.bar(b=2,a=1,c=3)
 #alt1#a.bar(2,a=1,3, 4)
 #alt1#a.bar(fail=1)
 #alt1#a.bar(a=1,a=1)
-#alt1#a.foo(c=1,d=1)
index 22f62f0..76d8ce1 100644 (file)
@@ -26,9 +26,9 @@ end
 var a = new A #alt1# var a = new B
 a.foo(a=1,b=2,3,4,e=5,f=6)
 a.foo(f=6,3,e=5,b=2,4,a=1)
-a.foo(3,e=5,b=2,4)
+#alt3#a.foo(3,e=5,b=2,4)
 
 var b = new B #alt1# var b = new A
 b.foo(x=1,y=2,3,4,u=5,v=6)
 b.foo(v=6,3,u=5,y=2,4,x=1)
-b.foo(3,u=5,y=2,4)
+#alt3#b.foo(3,u=5,y=2,4)
index a948eeb..9558e13 100644 (file)
@@ -33,10 +33,10 @@ end
 
 var a = new A
 a.foo(order(1),order(2),order(3),order(4),order(5),order(6))
+a.foo(a=order(1),b=order(2),c=order(3),d=order(4),e=order(5),f=order(6))
 a.foo(a=order(1),b=order(2),order(3),order(4),e=order(5),f=order(6))
 a.foo(f=order(6),order(3),e=order(5),b=order(2),order(4),a=order(1))
-a.foo(order(3),e=order(5),b=order(2),order(4))
-a.foo(order(3),order(4))
+a.foo(f=order(6),d=order(4),e=order(5),b=order(2),c=order(3),a=order(1))
 
 bar(order(1),order(2),order(3))
 bar(order(1),order(2),order(3),order(4))
index 61ea614..56ee59c 100644 (file)
@@ -1,17 +1,3 @@
-
-
-1
-2
-
-
--
-1
-
-2
-3
-
-
--
 1
 2
 3
index fba2f2b..40dd13d 100644 (file)
@@ -1,6 +1,8 @@
-alt/base_arg_default_alt1.nit:81,3--5: Error: expected at least 2 argument(s) for `foo(a: nullable Int, b: nullable Int, c: Int, d: Int, e: nullable Int, f: nullable Int)`; got 0. See introduction at `base_arg_default_alt1::A::foo`.
-alt/base_arg_default_alt1.nit:82,3--5: Error: expected at least 2 argument(s) for `foo(a: nullable Int, b: nullable Int, c: Int, d: Int, e: nullable Int, f: nullable Int)`; got 1. See introduction at `base_arg_default_alt1::A::foo`.
-alt/base_arg_default_alt1.nit:88,3--5: Error: expected at most 6 argument(s) for `foo(a: nullable Int, b: nullable Int, c: Int, d: Int, e: nullable Int, f: nullable Int)`; got 7. See introduction at `base_arg_default_alt1::A::foo`.
-alt/base_arg_default_alt1.nit:94,3--5: Error: expected at most 3 argument(s) for `bar(a: nullable Int, b: nullable Int, c: nullable Int)`; got 4. See introduction at `base_arg_default_alt1::A::bar`.
-alt/base_arg_default_alt1.nit:99,3--5: Error: expected at most 3 argument(s) for `bar=(a: nullable Int, b: nullable Int, c: nullable Int)`; got 4. See introduction at `base_arg_default_alt1::A::bar=`.
-alt/base_arg_default_alt1.nit:110,1--13: Error: expected at most 3 argument(s) for `[]=(a: nullable Int, b: nullable Int, c: nullable Int): Int`; got 4. See introduction at `base_arg_default_alt1::A::[]=`.
+alt/base_arg_default_alt1.nit:81,3--5: Error: expected at least 4 argument(s) for `foo(a: nullable Int, b: nullable Int, c: Int, d: Int, e: nullable Int, f: nullable Int)`; got 0. See introduction at `base_arg_default_alt1::A::foo`.
+alt/base_arg_default_alt1.nit:82,3--5: Error: expected at least 4 argument(s) for `foo(a: nullable Int, b: nullable Int, c: Int, d: Int, e: nullable Int, f: nullable Int)`; got 1. See introduction at `base_arg_default_alt1::A::foo`.
+alt/base_arg_default_alt1.nit:83,3--5: Error: expected at least 4 argument(s) for `foo(a: nullable Int, b: nullable Int, c: Int, d: Int, e: nullable Int, f: nullable Int)`; got 2. See introduction at `base_arg_default_alt1::A::foo`.
+alt/base_arg_default_alt1.nit:84,3--5: Error: expected at least 4 argument(s) for `foo(a: nullable Int, b: nullable Int, c: Int, d: Int, e: nullable Int, f: nullable Int)`; got 3. See introduction at `base_arg_default_alt1::A::foo`.
+alt/base_arg_default_alt1.nit:88,3--5: Error: expected 6 argument(s) for `foo(a: nullable Int, b: nullable Int, c: Int, d: Int, e: nullable Int, f: nullable Int)`; got 7. See introduction at `base_arg_default_alt1::A::foo`.
+alt/base_arg_default_alt1.nit:94,3--5: Error: expected 3 argument(s) for `bar(a: nullable Int, b: nullable Int, c: nullable Int)`; got 4. See introduction at `base_arg_default_alt1::A::bar`.
+alt/base_arg_default_alt1.nit:99,3--5: Error: expected 3 argument(s) for `bar=(a: nullable Int, b: nullable Int, c: nullable Int)`; got 4. See introduction at `base_arg_default_alt1::A::bar=`.
+alt/base_arg_default_alt1.nit:110,1--13: Error: expected 3 argument(s) for `[]=(a: nullable Int, b: nullable Int, c: nullable Int): Int`; got 4. See introduction at `base_arg_default_alt1::A::[]=`.
index 437e8ee..289d97c 100644 (file)
@@ -6,26 +6,11 @@
 2
 -
 1
-4
--
-1
-2
-4
--
-1
 2
 3
 4
 -
 1
  
-4
--
-1
 3
 4
index cdf6690..ccec709 100644 (file)
@@ -1,6 +1,9 @@
 alt/base_arg_default_autoinit_alt1.nit:59,5--7: Error: expected at least 1 argument(s) for `init(mandatory: Int, optional: nullable Int)`; got 0. See introduction at `standard::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:68,5--7: Error: expected at most 2 argument(s) for `init(mandatory: Int, optional: nullable Int)`; got 3. See introduction at `standard::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:71,5--7: Error: expected at least 2 argument(s) for `init(mandatory: Int, optional: nullable Int, optional_b: nullable Int, mandatory_b: Int)`; got 1. See introduction at `standard::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:83,5--7: Error: expected at most 4 argument(s) for `init(mandatory: Int, optional: nullable Int, optional_b: nullable Int, mandatory_b: Int)`; got 5. See introduction at `standard::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:86,5--7: Error: expected at least 2 argument(s) for `init(optional_b: nullable Int, mandatory_b: Int, mandatory: Int)`; got 1. See introduction at `standard::Object::init`.
-alt/base_arg_default_autoinit_alt1.nit:95,5--7: Error: expected at most 3 argument(s) for `init(optional_b: nullable Int, mandatory_b: Int, mandatory: Int)`; got 4. See introduction at `standard::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:68,5--7: Error: expected 2 argument(s) for `init(mandatory: Int, optional: nullable Int)`; got 3. See introduction at `standard::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:71,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional: nullable Int, optional_b: nullable Int, mandatory_b: Int)`; got 1. See introduction at `standard::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:74,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional: nullable Int, optional_b: nullable Int, mandatory_b: Int)`; got 2. See introduction at `standard::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:77,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional: nullable Int, optional_b: nullable Int, mandatory_b: Int)`; got 3. See introduction at `standard::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:83,5--7: Error: expected 4 argument(s) for `init(mandatory: Int, optional: nullable Int, optional_b: nullable Int, mandatory_b: Int)`; got 5. See introduction at `standard::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:86,5--7: Error: expected 3 argument(s) for `init(optional_b: nullable Int, mandatory_b: Int, mandatory: Int)`; got 1. See introduction at `standard::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:89,5--7: Error: expected 3 argument(s) for `init(optional_b: nullable Int, mandatory_b: Int, mandatory: Int)`; got 2. See introduction at `standard::Object::init`.
+alt/base_arg_default_autoinit_alt1.nit:95,5--7: Error: expected 3 argument(s) for `init(optional_b: nullable Int, mandatory_b: Int, mandatory: Int)`; got 4. See introduction at `standard::Object::init`.
index be2e49f..f31da85 100644 (file)
 5
 6
 -
-
+1
 2
 3
 4
 5
-
+6
+-
+1
+2
+3
+4
+5
+6
 -
 
 
index f41b60a..39b6ba4 100644 (file)
@@ -1,4 +1,4 @@
-alt/base_arg_named_alt1.nit:43,3--5: Error: expected at most 3 argument(s) for `bar(a: nullable Int, b: nullable Int, c: nullable Int)`; got 4. See introduction at `base_arg_default::A::bar`.
-alt/base_arg_named_alt1.nit:44,7--10: Error: no parameter `fail` for `bar(a: nullable Int, b: nullable Int, c: nullable Int)`.
-alt/base_arg_named_alt1.nit:45,11--13: Error: parameter `a` already associated with argument #0 for `bar(a: nullable Int, b: nullable Int, c: nullable Int)`.
-alt/base_arg_named_alt1.nit:46,7--9: Error: parameter `c` is not optional for `foo(a: nullable Int, b: nullable Int, c: Int, d: Int, e: nullable Int, f: nullable Int)`.
+alt/base_arg_named_alt1.nit:22,3--5: Error: expected at least 5 argument(s) for `foo(a: nullable Int, b: nullable Int, c: Int, d: Int, e: nullable Int, f: nullable Int)`; got 4. See introduction at `base_arg_default::A::foo`.
+alt/base_arg_named_alt1.nit:45,3--5: Error: expected 3 argument(s) for `bar(a: nullable Int, b: nullable Int, c: nullable Int)`; got 4. See introduction at `base_arg_default::A::bar`.
+alt/base_arg_named_alt1.nit:46,7--10: Error: no parameter `fail` for `bar(a: nullable Int, b: nullable Int, c: nullable Int)`.
+alt/base_arg_named_alt1.nit:47,11--13: Error: parameter `a` already associated with argument #0 for `bar(a: nullable Int, b: nullable Int, c: nullable Int)`.
index 17a46de..6be7ca2 100644 (file)
 5
 6
 -
-
-2
-3
-4
-5
-
--
 1
 2
 3
 5
 6
 -
-
-2
-3
-4
-5
-
--
index aa69f50..20528d9 100644 (file)
@@ -1,6 +1,4 @@
 alt/base_arg_named_inherit_alt1.nit:27,7: Error: no parameter `a` for `foo(x: nullable Int, y: nullable Int, z: Int, t: Int, u: nullable Int, v: nullable Int)`.
 alt/base_arg_named_inherit_alt1.nit:28,7: Error: no parameter `f` for `foo(x: nullable Int, y: nullable Int, z: Int, t: Int, u: nullable Int, v: nullable Int)`.
-alt/base_arg_named_inherit_alt1.nit:29,9: Error: no parameter `e` for `foo(x: nullable Int, y: nullable Int, z: Int, t: Int, u: nullable Int, v: nullable Int)`.
 alt/base_arg_named_inherit_alt1.nit:32,7: Error: no parameter `x` for `foo(a: nullable Int, b: nullable Int, c: Int, d: Int, e: nullable Int, f: nullable Int)`.
 alt/base_arg_named_inherit_alt1.nit:33,7: Error: no parameter `v` for `foo(a: nullable Int, b: nullable Int, c: Int, d: Int, e: nullable Int, f: nullable Int)`.
-alt/base_arg_named_inherit_alt1.nit:34,9: Error: no parameter `u` for `foo(a: nullable Int, b: nullable Int, c: Int, d: Int, e: nullable Int, f: nullable Int)`.
index 2a85022..29bba0d 100644 (file)
@@ -1,3 +1,2 @@
 alt/base_arg_named_inherit_alt2.nit:27,7: Error: no parameter `a` for `foo(x: nullable Int, y: nullable Int, z: Int, t: Int, u: nullable Int, v: nullable Int)`.
 alt/base_arg_named_inherit_alt2.nit:28,7: Error: no parameter `f` for `foo(x: nullable Int, y: nullable Int, z: Int, t: Int, u: nullable Int, v: nullable Int)`.
-alt/base_arg_named_inherit_alt2.nit:29,9: Error: no parameter `e` for `foo(x: nullable Int, y: nullable Int, z: Int, t: Int, u: nullable Int, v: nullable Int)`.
diff --git a/tests/sav/base_arg_named_inherit_alt3.res b/tests/sav/base_arg_named_inherit_alt3.res
new file mode 100644 (file)
index 0000000..46dfc27
--- /dev/null
@@ -0,0 +1,2 @@
+alt/base_arg_named_inherit_alt3.nit:29,3--5: Error: expected at least 5 argument(s) for `foo(a: nullable Int, b: nullable Int, c: Int, d: Int, e: nullable Int, f: nullable Int)`; got 4. See introduction at `base_arg_default::A::foo`.
+alt/base_arg_named_inherit_alt3.nit:34,3--5: Error: expected at least 5 argument(s) for `foo(x: nullable Int, y: nullable Int, z: Int, t: Int, u: nullable Int, v: nullable Int)`; got 4. See introduction at `base_arg_default::A::foo`.
index b16bf3f..7ed6845 100644 (file)
 5
 6
 -
->6
->3
->5
+>1
 >2
+>3
 >4
->1
+>5
+>6
 1
 2
 3
 5
 6
 -
+>6
 >3
 >5
 >2
 >4
-
+>1
+1
 2
 3
 4
 5
-
+6
 -
->3
+>6
 >4
-
-
+>5
+>2
+>3
+>1
+1
+2
 3
 4
-
-
+5
+6
 -
 >1
 >2