New test suite for closures
authorJean Privat <jean@pryen.org>
Wed, 21 Jan 2009 16:00:36 +0000 (11:00 -0500)
committerJean Privat <jean@pryen.org>
Wed, 21 Jan 2009 16:00:36 +0000 (11:00 -0500)
53 files changed:
tests/base_closure1.nit [new file with mode: 0644]
tests/base_closure2.nit [new file with mode: 0644]
tests/base_closure3.nit [new file with mode: 0644]
tests/base_closure4.nit [new file with mode: 0644]
tests/base_closure5.nit [new file with mode: 0644]
tests/base_closure6.nit [new file with mode: 0644]
tests/base_closure7.nit [new file with mode: 0644]
tests/base_closure8.nit [new file with mode: 0644]
tests/base_closure9.nit [new file with mode: 0644]
tests/base_closure_multi.nit [new file with mode: 0644]
tests/bench_int_range_closure.nit [new file with mode: 0644]
tests/bench_int_range_iterator.nit [new file with mode: 0644]
tests/sav/base_closure1_alt10.sav [new file with mode: 0644]
tests/sav/base_closure1_alt11.sav [new file with mode: 0644]
tests/sav/base_closure1_alt2.sav [new file with mode: 0644]
tests/sav/base_closure1_alt3.sav [new file with mode: 0644]
tests/sav/base_closure1_alt5.sav [new file with mode: 0644]
tests/sav/base_closure1_alt7.sav [new file with mode: 0644]
tests/sav/base_closure1_alt9.sav [new file with mode: 0644]
tests/sav/base_closure2_alt10.sav [new file with mode: 0644]
tests/sav/base_closure2_alt11.sav [new file with mode: 0644]
tests/sav/base_closure2_alt12.sav [new file with mode: 0644]
tests/sav/base_closure2_alt2.sav [new file with mode: 0644]
tests/sav/base_closure2_alt3.sav [new file with mode: 0644]
tests/sav/base_closure2_alt5.sav [new file with mode: 0644]
tests/sav/base_closure2_alt7.sav [new file with mode: 0644]
tests/sav/base_closure2_alt9.sav [new file with mode: 0644]
tests/sav/base_closure3_alt1.sav [new file with mode: 0644]
tests/sav/base_closure3_alt2.sav [new file with mode: 0644]
tests/sav/base_closure3_alt5.sav [new file with mode: 0644]
tests/sav/base_closure3_alt7.sav [new file with mode: 0644]
tests/sav/base_closure3_alt9.sav [new file with mode: 0644]
tests/sav/base_closure4_alt10.sav [new file with mode: 0644]
tests/sav/base_closure4_alt11.sav [new file with mode: 0644]
tests/sav/base_closure4_alt2.sav [new file with mode: 0644]
tests/sav/base_closure4_alt3.sav [new file with mode: 0644]
tests/sav/base_closure4_alt5.sav [new file with mode: 0644]
tests/sav/base_closure4_alt6.sav [new file with mode: 0644]
tests/sav/base_closure4_alt7.sav [new file with mode: 0644]
tests/sav/base_closure4_alt9.sav [new file with mode: 0644]
tests/sav/base_closure5_alt1.sav [new file with mode: 0644]
tests/sav/base_closure5_alt2.sav [new file with mode: 0644]
tests/sav/base_closure5_alt4.sav [new file with mode: 0644]
tests/sav/base_closure5_alt5.sav [new file with mode: 0644]
tests/sav/base_closure5_alt7.sav [new file with mode: 0644]
tests/sav/base_closure5_alt8.sav [new file with mode: 0644]
tests/sav/base_closure5_alt9.sav [new file with mode: 0644]
tests/sav/base_closure6.sav [new file with mode: 0644]
tests/sav/base_closure6_alt1.sav [new file with mode: 0644]
tests/sav/base_closure_multi_alt1.sav [new file with mode: 0644]
tests/sav/base_closure_multi_alt2.sav [new file with mode: 0644]
tests/sav/base_closure_multi_alt3.sav [new file with mode: 0644]
tests/sav/base_closure_multi_alt4.sav [new file with mode: 0644]

diff --git a/tests/base_closure1.nit b/tests/base_closure1.nit
new file mode 100644 (file)
index 0000000..6995966
--- /dev/null
@@ -0,0 +1,52 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Copyright 2009 Jean Privat <jean@pryen.org>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import kernel
+
+class A
+       meth foo
+               with bar
+       do
+               1.output
+               bar #!alt1#
+               #alt2#bar(2)
+               #alt3#var x = bar
+               4.output
+       end
+end
+
+meth work
+do
+       var a = new A
+       a.foo with do #!alt11#
+       #alt11#a.foo with x do
+               2.output
+               #alt4#break
+               #alt5#break 'x'
+               #alt6#continue
+               #alt7#continue 'x'
+               #alt8#return
+               #alt9#return 'x'
+               3.output
+       end
+       #alt10# a.foo
+       5.output
+end
+
+0.output
+work
+6.output
+
diff --git a/tests/base_closure2.nit b/tests/base_closure2.nit
new file mode 100644 (file)
index 0000000..25c59f7
--- /dev/null
@@ -0,0 +1,53 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Copyright 2009 Jean Privat <jean@pryen.org>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import kernel
+
+class A
+       meth foo
+               with bar(i: Int)
+       do
+               1.output
+               bar(2) #!alt1#
+               #alt2#bar
+               #alt12#bar('x')
+               #alt3#var x = bar(2)
+               4.output
+       end
+end
+
+meth work
+do
+       var a = new A
+       a.foo with x do #!alt11#
+       #alt11#a.foo with do
+               x.output
+               #alt4#break
+               #alt5#break 'x'
+               #alt6#continue
+               #alt7#continue 'x'
+               #alt8#return
+               #alt9#return 'x'
+               (x+1).output
+       end
+       #alt10# a.foo
+       5.output
+end
+
+0.output
+work
+6.output
+
diff --git a/tests/base_closure3.nit b/tests/base_closure3.nit
new file mode 100644 (file)
index 0000000..fae34bf
--- /dev/null
@@ -0,0 +1,47 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Copyright 2009 Jean Privat <jean@pryen.org>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import kernel
+
+class A
+       meth foo(i, j: Int)
+               with bar(k, l: Int, a: A)
+       do
+               i.output
+               bar(i+1, j-1, self)
+               #alt1#bar(i+1, j-1)
+               j.output
+       end
+end
+
+var a = new A
+0.output
+a.foo(1,8) with x, y, b do #!alt2#
+#alt2#a.foo(1,8) with x, y do
+       x.output
+       b.foo(x+1, y-1) with z, t, c do
+               z.output
+               #alt4#break
+               #alt5#break 'x'
+               #alt6#continue
+               #alt7#continue 'x'
+               #alt8#return
+               #alt9#return 'x'
+               t.output
+       end
+       y.output
+end
+9.output
diff --git a/tests/base_closure4.nit b/tests/base_closure4.nit
new file mode 100644 (file)
index 0000000..fb9edfc
--- /dev/null
@@ -0,0 +1,52 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Copyright 2009 Jean Privat <jean@pryen.org>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import kernel
+
+class A
+       meth foo
+               with bar: Int
+       do
+               1.output
+               bar.output #!alt1#
+               #alt2#bar(2)
+               #alt3#var x: Char = bar
+               4.output
+       end
+end
+
+meth work
+do
+       var a = new A
+       a.foo with do #!alt11#
+       #alt11#a.foo with x do
+               2.output
+               #alt4#break
+               #alt5#break 'x'
+               #alt6#continue
+               #alt7#continue 'x'
+               #alt8#return
+               #alt9#return 'x'
+               continue 3
+       end
+       #alt10# a.foo
+       5.output
+end
+
+0.output
+work
+6.output
+
diff --git a/tests/base_closure5.nit b/tests/base_closure5.nit
new file mode 100644 (file)
index 0000000..bef65e9
--- /dev/null
@@ -0,0 +1,52 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Copyright 2009 Jean Privat <jean@pryen.org>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import kernel
+
+class A
+       meth foo: Int
+               with bar: Int
+       do
+               1.output
+               var r = bar
+               3.output
+               return r
+       end
+end
+
+meth work: Int
+do
+       var a = new A
+       var i = a.foo with do
+               2.output
+               #alt1#break
+               #alt2#break 'x'
+               #alt3#break 100
+               #alt4#return
+               #alt5#return 'x'
+               #alt6#return 200
+               #alt7#continue
+               #alt8#continue 'x'
+               continue 5 #!alt9#
+       end
+       4.output
+       return i
+end
+
+0.output
+work.output
+6.output
+
diff --git a/tests/base_closure6.nit b/tests/base_closure6.nit
new file mode 100644 (file)
index 0000000..45f0e3a
--- /dev/null
@@ -0,0 +1,67 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Copyright 2009 Jean Privat <jean@pryen.org>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import kernel
+
+class A
+       meth foo: U
+               with bar
+       do
+               return null
+       end
+end
+
+class T
+end
+
+class U
+special T
+end
+
+class V
+special T
+end
+
+class W
+special U
+special V
+end
+
+var a = new A
+
+var t: T
+var u: U
+var v: V
+var w: W
+
+var y: Object
+#alt1#var y: U
+y = a.foo with do 0.output
+y = a.foo with do break t
+y = a.foo with do break u
+y = a.foo with do break v
+y = a.foo with do break w
+y = a.foo with do
+       break t
+       break u
+       break v
+       break w
+end
+y = a.foo with do
+       break u
+       break v
+       break w
+end
diff --git a/tests/base_closure7.nit b/tests/base_closure7.nit
new file mode 100644 (file)
index 0000000..56b3c70
--- /dev/null
@@ -0,0 +1,46 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Copyright 2009 Jean Privat <jean@pryen.org>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import kernel
+
+meth repeat(x: Int)
+       with each(i: Int)
+do
+       var c = 0
+       while c < x do
+               each(c)
+               c += 1
+       end
+end
+
+meth work
+do
+       repeat(4) with i do
+               i.output
+               repeat(4) with j do
+                       if i == 1 and j == 1 then continue
+                       if i == 2 and j == 2 then break
+                       if i == 3 and j == 3 then return
+                       ' '.output
+                       j.output
+               end
+               if i == 0 then continue
+               '\n'.output
+       end
+end
+
+work
+
diff --git a/tests/base_closure8.nit b/tests/base_closure8.nit
new file mode 100644 (file)
index 0000000..9043945
--- /dev/null
@@ -0,0 +1,53 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Copyright 2009 Jean Privat <jean@pryen.org>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import kernel
+
+class A
+       meth foo(i: Int)
+               with bar
+       do
+               '['.output
+               i.output
+               bar with do
+                       '!'.output
+                       i.output
+               end
+               ']'.output
+               i.output
+       end
+end
+
+meth start
+do
+       var a = new A
+       0.output
+       a.foo(1) with do 
+               2.output
+               a.foo(3) with do
+                       4.output
+                       #alt1#break
+                       #alt2#continue
+                       #alt3#return
+                       5.output
+               end
+               6.output
+       end
+       7.output
+end
+
+start
+8.output
diff --git a/tests/base_closure9.nit b/tests/base_closure9.nit
new file mode 100644 (file)
index 0000000..d23abb5
--- /dev/null
@@ -0,0 +1,74 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Copyright 2009 Jean Privat <jean@pryen.org>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import kernel
+
+class A
+       meth indent(i: Int, j, c: Char)
+       do
+               var ii = i
+               while ii > 0 do
+                       ' '.output
+                       ii -= 1
+               end
+               c.output
+               j.output
+               ','.output
+               i.output
+       end
+
+       meth foo(i: Int, j: Char)
+               with bar
+       do
+               if i >= 3 then
+                       indent(i, j, '{')
+                       bar
+                       indent(i, j, '}')
+                       return
+               end
+
+               indent(i, j, '[')
+               foo(i+1, 'a') with do
+                       foo(i+1, 'b') with do
+                               foo(i+1, 'c') with do
+                                       indent(i, j, '<')
+                                       bar
+                                       indent(i, j, '>')
+                               end
+                       end
+               end
+               indent(i, j, ']')
+       end
+end
+
+meth start
+do
+       var a = new A
+       0.output
+       a.foo(0, 'A') with do 
+               a.foo(0, 'B') with do 
+                       a.foo(0, 'C') with do 
+                               1.output
+                               #alt1# break
+                               #alt2# return
+                       end
+               end
+       end
+       2.output
+end
+
+start
+3.output
diff --git a/tests/base_closure_multi.nit b/tests/base_closure_multi.nit
new file mode 100644 (file)
index 0000000..743a3cf
--- /dev/null
@@ -0,0 +1,73 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Copyright 2009 Jean Privat <jean@pryen.org>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import kernel
+
+meth a
+       with a1
+       with a2 #!alt1#
+#alt2# with a3
+do
+       a1
+       a2 #!alt1#
+#alt2# a3
+end
+
+meth b
+       with b1
+       with b2
+do
+       b1
+       b2
+end
+
+meth c
+       with c1
+do
+       c1
+end
+
+meth d
+       with d1
+       with d2
+       with d3
+do
+       d1
+       d2
+       d3
+end
+
+0.output
+a with do
+       b with do
+               1.output
+       with do #!alt3#
+               2.output #!alt3#
+#alt4# with do
+#alt4#         20.output
+       end
+with do
+       3.output
+end
+4.output
+c with do
+       d with do
+               5.output
+       with do
+               6.output
+       with do 7.output
+end
+8.output
diff --git a/tests/bench_int_range_closure.nit b/tests/bench_int_range_closure.nit
new file mode 100644 (file)
index 0000000..16e6e7b
--- /dev/null
@@ -0,0 +1,45 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Copyright 2009 Jean Privat <jean@pryen.org>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+redef class Range[K]
+       meth for_each(x: Int)
+               with each(i: K)
+       do
+               var c = first
+               var s = after
+               while c < s do
+                       #print(("  " * x) + c.to_s)
+                       each(c)
+                       c = c.succ
+               end
+       end
+end
+
+var nb = 5
+if not args.is_empty then nb = args.first.to_i
+
+var cpt = 0
+var r = [0..nb[
+r.for_each(0) with ii1 do
+       r.for_each(1) with ii2 do
+               r.for_each(2) with ii3 do
+                       if ii1 == ii2 and ii2 == ii3 then cpt += 1
+               end
+       end
+end
+
+print cpt
diff --git a/tests/bench_int_range_iterator.nit b/tests/bench_int_range_iterator.nit
new file mode 100644 (file)
index 0000000..17f24d2
--- /dev/null
@@ -0,0 +1,44 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Copyright 2009 Jean Privat <jean@pryen.org>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+var nb = 5
+if not args.is_empty then nb = args.first.to_i
+
+var cpt = 0
+var r = [0..nb[
+var i1 = r.iterator
+while i1.is_ok do
+       var ii1 = i1.item
+
+       var i2 = r.iterator
+       while i2.is_ok do
+               var ii2 = i2.item
+
+               var i3 = r.iterator
+               while i3.is_ok do
+                       var ii3 = i3.item
+
+                       if ii1 == ii2 and ii2 == ii3 then cpt += 1
+
+                       i3.next
+               end
+       
+               i2.next
+       end
+       i1.next
+end
+
+print cpt
diff --git a/tests/sav/base_closure1_alt10.sav b/tests/sav/base_closure1_alt10.sav
new file mode 100644 (file)
index 0000000..18489ae
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure1_alt10.nit:45,3--7: Error: property foo requires 1 blocs.
diff --git a/tests/sav/base_closure1_alt11.sav b/tests/sav/base_closure1_alt11.sav
new file mode 100644 (file)
index 0000000..166186e
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure1_alt11.nit:34,8--42:10: Error: 0 automatic variable names expected, 1 found.
diff --git a/tests/sav/base_closure1_alt2.sav b/tests/sav/base_closure1_alt2.sav
new file mode 100644 (file)
index 0000000..0476d1c
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure1_alt2.nit:25,3--7: Error: 'bar' arity missmatch.
diff --git a/tests/sav/base_closure1_alt3.sav b/tests/sav/base_closure1_alt3.sav
new file mode 100644 (file)
index 0000000..c781e3b
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure1_alt3.nit:26,11--13: Type error: expected expression.
diff --git a/tests/sav/base_closure1_alt5.sav b/tests/sav/base_closure1_alt5.sav
new file mode 100644 (file)
index 0000000..9d3f3c2
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure1_alt5.nit:38,3--11: Error: break without value required in this bloc.
diff --git a/tests/sav/base_closure1_alt7.sav b/tests/sav/base_closure1_alt7.sav
new file mode 100644 (file)
index 0000000..dbf1a0f
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure1_alt7.nit:40,3--14: Error: continue without value required in this bloc.
diff --git a/tests/sav/base_closure1_alt9.sav b/tests/sav/base_closure1_alt9.sav
new file mode 100644 (file)
index 0000000..a50076e
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure1_alt9.nit:42,3--12: Error: Return with value in a procedure.
diff --git a/tests/sav/base_closure2_alt10.sav b/tests/sav/base_closure2_alt10.sav
new file mode 100644 (file)
index 0000000..b713fb2
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure2_alt10.nit:46,3--7: Error: property foo requires 1 blocs.
diff --git a/tests/sav/base_closure2_alt11.sav b/tests/sav/base_closure2_alt11.sav
new file mode 100644 (file)
index 0000000..6e210a6
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure2_alt11.nit:35,8--43:14: Error: 1 automatic variable names expected, 0 found.
diff --git a/tests/sav/base_closure2_alt12.sav b/tests/sav/base_closure2_alt12.sav
new file mode 100644 (file)
index 0000000..ee02702
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure2_alt12.nit:26,7--9: Type error: expected Int, got Char
diff --git a/tests/sav/base_closure2_alt2.sav b/tests/sav/base_closure2_alt2.sav
new file mode 100644 (file)
index 0000000..90c7a59
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure2_alt2.nit:25,3--5: Error: 'bar' arity missmatch.
diff --git a/tests/sav/base_closure2_alt3.sav b/tests/sav/base_closure2_alt3.sav
new file mode 100644 (file)
index 0000000..05bb8b7
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure2_alt3.nit:27,11--15: Type error: expected expression.
diff --git a/tests/sav/base_closure2_alt5.sav b/tests/sav/base_closure2_alt5.sav
new file mode 100644 (file)
index 0000000..4302ddf
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure2_alt5.nit:39,3--11: Error: break without value required in this bloc.
diff --git a/tests/sav/base_closure2_alt7.sav b/tests/sav/base_closure2_alt7.sav
new file mode 100644 (file)
index 0000000..9dc0723
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure2_alt7.nit:41,3--14: Error: continue without value required in this bloc.
diff --git a/tests/sav/base_closure2_alt9.sav b/tests/sav/base_closure2_alt9.sav
new file mode 100644 (file)
index 0000000..0c48f6c
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure2_alt9.nit:43,3--12: Error: Return with value in a procedure.
diff --git a/tests/sav/base_closure3_alt1.sav b/tests/sav/base_closure3_alt1.sav
new file mode 100644 (file)
index 0000000..3634719
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure3_alt1.nit:25,3--14: Error: 'bar' arity missmatch.
diff --git a/tests/sav/base_closure3_alt2.sav b/tests/sav/base_closure3_alt2.sav
new file mode 100644 (file)
index 0000000..f2a8a61
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure3_alt2.nit:32,12--44:9: Error: 3 automatic variable names expected, 2 found.
diff --git a/tests/sav/base_closure3_alt5.sav b/tests/sav/base_closure3_alt5.sav
new file mode 100644 (file)
index 0000000..198cd4c
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure3_alt5.nit:38,3--11: Error: break without value required in this bloc.
diff --git a/tests/sav/base_closure3_alt7.sav b/tests/sav/base_closure3_alt7.sav
new file mode 100644 (file)
index 0000000..a295c1b
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure3_alt7.nit:40,3--14: Error: continue without value required in this bloc.
diff --git a/tests/sav/base_closure3_alt9.sav b/tests/sav/base_closure3_alt9.sav
new file mode 100644 (file)
index 0000000..186935c
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure3_alt9.nit:42,3--12: Error: Return with value in a procedure.
diff --git a/tests/sav/base_closure4_alt10.sav b/tests/sav/base_closure4_alt10.sav
new file mode 100644 (file)
index 0000000..374da95
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure4_alt10.nit:45,3--7: Error: property foo requires 1 blocs.
diff --git a/tests/sav/base_closure4_alt11.sav b/tests/sav/base_closure4_alt11.sav
new file mode 100644 (file)
index 0000000..c79e06e
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure4_alt11.nit:34,8--42:12: Error: 0 automatic variable names expected, 1 found.
diff --git a/tests/sav/base_closure4_alt2.sav b/tests/sav/base_closure4_alt2.sav
new file mode 100644 (file)
index 0000000..e8cf91f
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure4_alt2.nit:25,3--7: Error: 'bar' arity missmatch.
diff --git a/tests/sav/base_closure4_alt3.sav b/tests/sav/base_closure4_alt3.sav
new file mode 100644 (file)
index 0000000..a37aeee
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure4_alt3.nit:26,17--19: Type error: expected Char, got Int
diff --git a/tests/sav/base_closure4_alt5.sav b/tests/sav/base_closure4_alt5.sav
new file mode 100644 (file)
index 0000000..cdc377e
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure4_alt5.nit:38,3--11: Error: break without value required in this bloc.
diff --git a/tests/sav/base_closure4_alt6.sav b/tests/sav/base_closure4_alt6.sav
new file mode 100644 (file)
index 0000000..53edc8e
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure4_alt6.nit:39,3--10: Error: continue with a value required in this bloc.
diff --git a/tests/sav/base_closure4_alt7.sav b/tests/sav/base_closure4_alt7.sav
new file mode 100644 (file)
index 0000000..905e4f7
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure4_alt7.nit:40,12--14: Type error: expected Int, got Char
diff --git a/tests/sav/base_closure4_alt9.sav b/tests/sav/base_closure4_alt9.sav
new file mode 100644 (file)
index 0000000..7b77ce7
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure4_alt9.nit:42,3--12: Error: Return with value in a procedure.
diff --git a/tests/sav/base_closure5_alt1.sav b/tests/sav/base_closure5_alt1.sav
new file mode 100644 (file)
index 0000000..98622b2
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure5_alt1.nit:35,3--7: Error: break with a value required in this bloc.
diff --git a/tests/sav/base_closure5_alt2.sav b/tests/sav/base_closure5_alt2.sav
new file mode 100644 (file)
index 0000000..89f09a2
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure5_alt2.nit:36,9--11: Type error: expected Int, got Char
diff --git a/tests/sav/base_closure5_alt4.sav b/tests/sav/base_closure5_alt4.sav
new file mode 100644 (file)
index 0000000..7608f9f
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure5_alt4.nit:38,3--8: Error: Return without value in a function.
diff --git a/tests/sav/base_closure5_alt5.sav b/tests/sav/base_closure5_alt5.sav
new file mode 100644 (file)
index 0000000..4d5320b
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure5_alt5.nit:39,10--12: Type error: expected Int, got Char
diff --git a/tests/sav/base_closure5_alt7.sav b/tests/sav/base_closure5_alt7.sav
new file mode 100644 (file)
index 0000000..206cc02
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure5_alt7.nit:41,3--10: Error: continue with a value required in this bloc.
diff --git a/tests/sav/base_closure5_alt8.sav b/tests/sav/base_closure5_alt8.sav
new file mode 100644 (file)
index 0000000..3652075
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure5_alt8.nit:42,12--14: Type error: expected Int, got Char
diff --git a/tests/sav/base_closure5_alt9.sav b/tests/sav/base_closure5_alt9.sav
new file mode 100644 (file)
index 0000000..f8180a9
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure5_alt9.nit:33,16--34:10: Control error: Reached end of bloc (a 'continue' with a value was expected).
diff --git a/tests/sav/base_closure6.sav b/tests/sav/base_closure6.sav
new file mode 100644 (file)
index 0000000..8608be2
--- /dev/null
@@ -0,0 +1,2 @@
+./base_closure6.nit:55,25--25: Type error: expected U, got V
+./base_closure6.nit:65,8--8: Type error: expected U, got V
diff --git a/tests/sav/base_closure6_alt1.sav b/tests/sav/base_closure6_alt1.sav
new file mode 100644 (file)
index 0000000..7098be8
--- /dev/null
@@ -0,0 +1,4 @@
+alt/base_closure6_alt1.nit:53,5--25: Type error: expected U, got T
+alt/base_closure6_alt1.nit:55,25--25: Type error: expected U, got V
+alt/base_closure6_alt1.nit:57,5--61:8: Type error: expected U, got T
+alt/base_closure6_alt1.nit:65,8--8: Type error: expected U, got V
diff --git a/tests/sav/base_closure_multi_alt1.sav b/tests/sav/base_closure_multi_alt1.sav
new file mode 100644 (file)
index 0000000..8e2826e
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure_multi_alt1.nit:52,1--61:9: Error: property a requires 1 blocs, 2 found.
diff --git a/tests/sav/base_closure_multi_alt2.sav b/tests/sav/base_closure_multi_alt2.sav
new file mode 100644 (file)
index 0000000..265cc8d
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure_multi_alt2.nit:54,1--63:9: Error: property a requires 3 blocs, 2 found.
diff --git a/tests/sav/base_closure_multi_alt3.sav b/tests/sav/base_closure_multi_alt3.sav
new file mode 100644 (file)
index 0000000..2acde52
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure_multi_alt3.nit:55,2--56:10: Error: property b requires 2 blocs, 1 found.
diff --git a/tests/sav/base_closure_multi_alt4.sav b/tests/sav/base_closure_multi_alt4.sav
new file mode 100644 (file)
index 0000000..ee09b6a
--- /dev/null
@@ -0,0 +1 @@
+alt/base_closure_multi_alt4.nit:55,2--60:11: Error: property b requires 2 blocs, 3 found.