[Swift-commit] r4623 - in trunk/tests/language-behaviour: . foreach

achavez at ci.uchicago.edu achavez at ci.uchicago.edu
Thu Jun 16 13:03:24 CDT 2011


Author: achavez
Date: 2011-06-16 13:03:24 -0500 (Thu, 16 Jun 2011)
New Revision: 4623

Added:
   trunk/tests/language-behaviour/foreach/
   trunk/tests/language-behaviour/foreach/0083-for.one.in
   trunk/tests/language-behaviour/foreach/0083-for.one.in.out.expected
   trunk/tests/language-behaviour/foreach/0083-for.swift
   trunk/tests/language-behaviour/foreach/0083-for.two.in
   trunk/tests/language-behaviour/foreach/0083-for.two.in.out.expected
   trunk/tests/language-behaviour/foreach/0084-for.swift
   trunk/tests/language-behaviour/foreach/050-foreach.blue.out.expected
   trunk/tests/language-behaviour/foreach/050-foreach.green.out.expected
   trunk/tests/language-behaviour/foreach/050-foreach.red.out.expected
   trunk/tests/language-behaviour/foreach/050-foreach.swift
   trunk/tests/language-behaviour/foreach/051-foreach.blue.out.expected
   trunk/tests/language-behaviour/foreach/051-foreach.green.out.expected
   trunk/tests/language-behaviour/foreach/051-foreach.red.out.expected
   trunk/tests/language-behaviour/foreach/051-foreach.swift
   trunk/tests/language-behaviour/foreach/052-foreach-index.blue.out.expected
   trunk/tests/language-behaviour/foreach/052-foreach-index.green.out.expected
   trunk/tests/language-behaviour/foreach/052-foreach-index.red.out.expected
   trunk/tests/language-behaviour/foreach/052-foreach-index.swift
   trunk/tests/language-behaviour/foreach/056-foreach-if.swift
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.check.sh
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.clean.sh
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0000.out.expected
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0001.out.expected
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0002.out.expected
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0003.out.expected
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0004.out.expected
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0005.out.expected
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0006.out.expected
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0007.out.expected
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0008.out.expected
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0009.out.expected
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0000.out.expected
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0001.out.expected
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0002.out.expected
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0003.out.expected
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0004.out.expected
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0005.out.expected
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0006.out.expected
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0007.out.expected
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0008.out.expected
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0009.out.expected
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.setup.sh
   trunk/tests/language-behaviour/foreach/057-foreach-twice-range.swift
   trunk/tests/language-behaviour/foreach/058-foreach-twice-string.check.sh
   trunk/tests/language-behaviour/foreach/058-foreach-twice-string.clean.sh
   trunk/tests/language-behaviour/foreach/058-foreach-twice-string.first.0000.out.expected
   trunk/tests/language-behaviour/foreach/058-foreach-twice-string.first.0001.out.expected
   trunk/tests/language-behaviour/foreach/058-foreach-twice-string.first.0002.out.expected
   trunk/tests/language-behaviour/foreach/058-foreach-twice-string.second.0000.out.expected
   trunk/tests/language-behaviour/foreach/058-foreach-twice-string.second.0001.out.expected
   trunk/tests/language-behaviour/foreach/058-foreach-twice-string.second.0002.out.expected
   trunk/tests/language-behaviour/foreach/058-foreach-twice-string.setup.sh
   trunk/tests/language-behaviour/foreach/058-foreach-twice-string.swift
   trunk/tests/language-behaviour/foreach/085-iterate.swift
   trunk/tests/language-behaviour/foreach/0851-iterate-using-body-variables.swift
   trunk/tests/language-behaviour/foreach/title.txt
Removed:
   trunk/tests/language-behaviour/foreach/
Log:
Subgroup of tests for iterations

Added: trunk/tests/language-behaviour/foreach/0083-for.one.in
===================================================================
--- trunk/tests/language-behaviour/foreach/0083-for.one.in	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/0083-for.one.in	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+LLLL

Added: trunk/tests/language-behaviour/foreach/0083-for.one.in.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/0083-for.one.in.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/0083-for.one.in.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+./0083-for.one.in

Added: trunk/tests/language-behaviour/foreach/0083-for.swift
===================================================================
--- trunk/tests/language-behaviour/foreach/0083-for.swift	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/0083-for.swift	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1,17 @@
+type file;                                                                    
+
+
+(file t) echo(string m) { 
+    app {
+        echo m stdout=@filename(t);
+    }
+}
+
+                                                                                
+file f1[] <filesys_mapper;pattern="0083-for*.in",location=".">;                       
+                                                                                
+foreach i1 in f1 {                                                              
+  string fn = @filename(i1);
+  file o <single_file_mapper;file=@strcat(fn,".out")>;
+  o = echo(fn);
+}                                                                               

Added: trunk/tests/language-behaviour/foreach/0083-for.two.in
===================================================================
--- trunk/tests/language-behaviour/foreach/0083-for.two.in	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/0083-for.two.in	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+RRRR

Added: trunk/tests/language-behaviour/foreach/0083-for.two.in.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/0083-for.two.in.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/0083-for.two.in.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+./0083-for.two.in

Added: trunk/tests/language-behaviour/foreach/0084-for.swift
===================================================================
--- trunk/tests/language-behaviour/foreach/0084-for.swift	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/0084-for.swift	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1,14 @@
+type file;                                                                    
+
+
+(file t) echo(string m) { 
+    app {
+        echo m stdout=@filename(t);
+    }
+}
+
+                                                                                
+file f1[] <filesys_mapper;pattern="0083-for*.in",location=".">;                       
+                                                                                
+foreach i1 in f1 {                                                              
+}                                                                               

Added: trunk/tests/language-behaviour/foreach/050-foreach.blue.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/050-foreach.blue.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/050-foreach.blue.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+test

Added: trunk/tests/language-behaviour/foreach/050-foreach.green.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/050-foreach.green.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/050-foreach.green.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+test

Added: trunk/tests/language-behaviour/foreach/050-foreach.red.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/050-foreach.red.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/050-foreach.red.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+test

Added: trunk/tests/language-behaviour/foreach/050-foreach.swift
===================================================================
--- trunk/tests/language-behaviour/foreach/050-foreach.swift	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/050-foreach.swift	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1,15 @@
+type messagefile {}
+
+(messagefile t) greeting() { 
+    app {
+        echo "test" stdout=@filename(t);
+    }
+}
+
+string array[] = ["red", "green", "blue"];
+
+foreach s in array {
+  messagefile outfile <single_file_mapper;file=@strcat("050-foreach.",s,".out")>;
+  outfile = greeting();
+}
+

Added: trunk/tests/language-behaviour/foreach/051-foreach.blue.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/051-foreach.blue.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/051-foreach.blue.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+The filename is: 051-foreach.blue.out and the loop var is: blue

Added: trunk/tests/language-behaviour/foreach/051-foreach.green.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/051-foreach.green.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/051-foreach.green.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+The filename is: 051-foreach.green.out and the loop var is: green

Added: trunk/tests/language-behaviour/foreach/051-foreach.red.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/051-foreach.red.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/051-foreach.red.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+The filename is: 051-foreach.red.out and the loop var is: red

Added: trunk/tests/language-behaviour/foreach/051-foreach.swift
===================================================================
--- trunk/tests/language-behaviour/foreach/051-foreach.swift	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/051-foreach.swift	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1,20 @@
+type messagefile {}
+
+(messagefile t) greeting(string l) { 
+    app {
+        echo @strcat("The filename is: ", @filename(t),
+                     " and the loop var is: ", l) 
+             stdout=@filename(t);
+    }
+}
+
+string array[] = ["red", "green", "blue"];
+
+foreach s in array {
+  messagefile outfile <
+      single_file_mapper;
+      file=@strcat("051-foreach.",s,".out")
+     >;
+  outfile = greeting(s);
+}
+

Added: trunk/tests/language-behaviour/foreach/052-foreach-index.blue.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/052-foreach-index.blue.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/052-foreach-index.blue.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+The filename is: 052-foreach-index.blue.out, the loop var is: blueand the index is: 2

Added: trunk/tests/language-behaviour/foreach/052-foreach-index.green.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/052-foreach-index.green.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/052-foreach-index.green.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+The filename is: 052-foreach-index.green.out, the loop var is: greenand the index is: 1

Added: trunk/tests/language-behaviour/foreach/052-foreach-index.red.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/052-foreach-index.red.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/052-foreach-index.red.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+The filename is: 052-foreach-index.red.out, the loop var is: redand the index is: 0

Added: trunk/tests/language-behaviour/foreach/052-foreach-index.swift
===================================================================
--- trunk/tests/language-behaviour/foreach/052-foreach-index.swift	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/052-foreach-index.swift	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1,26 @@
+type messagefile {}
+
+(messagefile t) greeting(int ix, string l) { 
+    app {
+        echo @strcat("The filename is: ", @filename(t),
+                     ", the loop var is: ", l,
+                     "and the index is: ", ix)
+             stdout=@filename(t);
+    }
+}
+
+string array[] = ["red", "green", "blue"];
+
+// this highlights a bug, at least after all commits
+// that 'index' is being treated as a string, not as
+// an integer...
+
+// try this test earlier on, though
+foreach s, index in array {
+  messagefile outfile <
+      single_file_mapper;
+      file=@strcat("052-foreach-index.",s,".out")
+     >;
+  outfile = greeting(index, s);
+}
+

Added: trunk/tests/language-behaviour/foreach/056-foreach-if.swift
===================================================================
--- trunk/tests/language-behaviour/foreach/056-foreach-if.swift	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/056-foreach-if.swift	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1,26 @@
+type messagefile {}
+
+(messagefile t) greeting(int ix, string l) { 
+    app {
+        echo @strcat("The filename is: ", @filename(t),
+                     ", the loop var is: ", l,
+                     "and the index is: ", ix)
+             stdout=@filename(t);
+    }
+}
+
+string array[] = ["red", "green", "blue"];
+
+// this highlights a bug, at least after all commits
+// that 'index' is being treated as a string, not as
+// an integer...
+
+messagefile outfiles[];
+
+// try this test earlier on, though
+foreach s, index in array {
+  if( index %% 2 == 1) {
+     outfiles[index] = greeting(index, s);
+  }
+}
+

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.check.sh
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.check.sh	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.check.sh	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+set -x
+
+for count in `seq --format "%04.f" 0 1 9`
+do
+	[ -f "057-foreach-twice-range.first.$count.out" ] || exit 1
+	CONTENTS1=$( cat 057-foreach-twice-range.first.$count.out.expected )
+	CONTENTS2=$( cat 057-foreach-twice-range.first.$count.out )
+	[[ $CONTENTS1 == $CONTENTS2 ]] || exit 1
+	[ -f "057-foreach-twice-range.second.$count.out" ] || exit 1
+	CONTENTS3=$( cat 057-foreach-twice-range.second.$count.out.expected )
+	CONTENTS4=$( cat 057-foreach-twice-range.second.$count.out )
+	[[ $CONTENTS3 == $CONTENTS4 ]] || exit 1
+done
+exit 0
+


Property changes on: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.check.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.clean.sh
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.clean.sh	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.clean.sh	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+set -x
+
+rm -v 057-foreach-twice-range.*.out || exit 1
+
+exit 0


Property changes on: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.clean.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0000.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0000.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0000.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+test1-0

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0001.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0001.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0001.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+test1-1

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0002.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0002.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0002.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+test1-2

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0003.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0003.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0003.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+test1-3

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0004.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0004.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0004.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+test1-4

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0005.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0005.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0005.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+test1-5

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0006.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0006.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0006.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+test1-6

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0007.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0007.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0007.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+test1-7

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0008.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0008.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0008.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+test1-8

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0009.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0009.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.first.0009.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+test1-9

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0000.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0000.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0000.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+test2-0

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0001.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0001.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0001.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+test2-1

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0002.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0002.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0002.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+test2-2

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0003.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0003.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0003.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+test2-3

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0004.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0004.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0004.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+test2-4

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0005.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0005.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0005.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+test2-5

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0006.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0006.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0006.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+test2-6

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0007.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0007.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0007.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+test2-7

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0008.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0008.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0008.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+test2-8

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0009.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0009.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.second.0009.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+test2-9

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.setup.sh
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.setup.sh	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.setup.sh	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+cp -v $GROUP/057*expected . || exit 1


Property changes on: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.setup.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/language-behaviour/foreach/057-foreach-twice-range.swift
===================================================================
--- trunk/tests/language-behaviour/foreach/057-foreach-twice-range.swift	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/057-foreach-twice-range.swift	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1,20 @@
+type file;
+
+app (file o) echo (string msg)
+{
+  echo msg stdout=@o;
+}
+
+file out[]<simple_mapper; location=".", prefix="057-foreach-twice-range.first.",suffix=".out">;
+file out2[]<simple_mapper; location=".", prefix="057-foreach-twice-range.second.",suffix=".out">;
+
+foreach a,i in [0:9] {
+  string s = @strcat("test1-", i);
+  out[i] = echo(s);
+}
+
+foreach a,i in [0:9] {
+  string s = @strcat("test2-", i);
+  out2[i] = echo(s);
+}
+

Added: trunk/tests/language-behaviour/foreach/058-foreach-twice-string.check.sh
===================================================================
--- trunk/tests/language-behaviour/foreach/058-foreach-twice-string.check.sh	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/058-foreach-twice-string.check.sh	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+set -x
+
+for count in `seq --format "%04.f" 0 1 2`
+do
+	[ -f "058-foreach-twice-string.first.$count.out" ] || exit 1
+	CONTENTS1=$( cat 058-foreach-twice-string.first.$count.out.expected )
+	CONTENTS2=$( cat 058-foreach-twice-string.first.$count.out )
+	[[ $CONTENTS1 == $CONTENTS2 ]] || exit 1
+	[ -f "058-foreach-twice-string.second.$count.out" ] || exit 1
+	CONTENTS3=$( cat 058-foreach-twice-string.second.$count.out.expected )
+	CONTENTS4=$( cat 058-foreach-twice-string.second.$count.out )
+	[[ $CONTENTS3 == $CONTENTS4 ]] || exit 1
+done
+exit 0
+


Property changes on: trunk/tests/language-behaviour/foreach/058-foreach-twice-string.check.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/language-behaviour/foreach/058-foreach-twice-string.clean.sh
===================================================================
--- trunk/tests/language-behaviour/foreach/058-foreach-twice-string.clean.sh	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/058-foreach-twice-string.clean.sh	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+set -x
+
+rm -v 058-foreach-twice-string.*.out || exit 1
+exit 0


Property changes on: trunk/tests/language-behaviour/foreach/058-foreach-twice-string.clean.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/language-behaviour/foreach/058-foreach-twice-string.first.0000.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/058-foreach-twice-string.first.0000.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/058-foreach-twice-string.first.0000.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+zero

Added: trunk/tests/language-behaviour/foreach/058-foreach-twice-string.first.0001.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/058-foreach-twice-string.first.0001.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/058-foreach-twice-string.first.0001.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+one

Added: trunk/tests/language-behaviour/foreach/058-foreach-twice-string.first.0002.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/058-foreach-twice-string.first.0002.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/058-foreach-twice-string.first.0002.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+two

Added: trunk/tests/language-behaviour/foreach/058-foreach-twice-string.second.0000.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/058-foreach-twice-string.second.0000.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/058-foreach-twice-string.second.0000.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+zero

Added: trunk/tests/language-behaviour/foreach/058-foreach-twice-string.second.0001.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/058-foreach-twice-string.second.0001.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/058-foreach-twice-string.second.0001.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+one

Added: trunk/tests/language-behaviour/foreach/058-foreach-twice-string.second.0002.out.expected
===================================================================
--- trunk/tests/language-behaviour/foreach/058-foreach-twice-string.second.0002.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/058-foreach-twice-string.second.0002.out.expected	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+two

Added: trunk/tests/language-behaviour/foreach/058-foreach-twice-string.setup.sh
===================================================================
--- trunk/tests/language-behaviour/foreach/058-foreach-twice-string.setup.sh	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/058-foreach-twice-string.setup.sh	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+cp -v $GROUP/058*expected . || exit 1


Property changes on: trunk/tests/language-behaviour/foreach/058-foreach-twice-string.setup.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/language-behaviour/foreach/058-foreach-twice-string.swift
===================================================================
--- trunk/tests/language-behaviour/foreach/058-foreach-twice-string.swift	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/058-foreach-twice-string.swift	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1,19 @@
+type file;
+
+app (file o) echo (string f)
+{
+  echo @f stdout=@o;
+}
+
+file out[]<simple_mapper; location=".", prefix="058-foreach-twice-string.first.",suffix=".out">;
+file out2[]<simple_mapper; location=".", prefix="058-foreach-twice-string.second.",suffix=".out">;
+string words[] = ["zero", "one", "two"];
+
+foreach w,i in words {
+  out[i] = echo(w);
+}
+
+foreach w,i in words {
+  out2[i] = echo(w);
+}
+

Copied: trunk/tests/language-behaviour/foreach/085-iterate.swift (from rev 4602, trunk/tests/language-behaviour/085-iterate.swift)
===================================================================
--- trunk/tests/language-behaviour/foreach/085-iterate.swift	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/085-iterate.swift	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1,17 @@
+type messagefile;
+
+(messagefile t) greeting() { 
+    app {
+        echo "hello" stdout=@filename(t);
+    }
+}
+
+messagefile outfile[] <simple_mapper;
+                     prefix="085-iterate.",
+                     suffix=".out">;
+
+iterate i {
+  outfile[i] = greeting();
+} until(i>10);
+
+

Copied: trunk/tests/language-behaviour/foreach/0851-iterate-using-body-variables.swift (from rev 4602, trunk/tests/language-behaviour/0851-iterate-using-body-variables.swift)
===================================================================
--- trunk/tests/language-behaviour/foreach/0851-iterate-using-body-variables.swift	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/0851-iterate-using-body-variables.swift	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1,18 @@
+type messagefile;
+
+(messagefile t) greeting() { 
+    app {
+        echo "hello" stdout=@filename(t);
+    }
+}
+
+messagefile outfile[] <simple_mapper;
+                     prefix="085-iterate.",
+                     suffix=".out">;
+
+iterate i {
+  int j = i;
+  outfile[i] = greeting();
+} until(j>10);
+
+

Added: trunk/tests/language-behaviour/foreach/title.txt
===================================================================
--- trunk/tests/language-behaviour/foreach/title.txt	                        (rev 0)
+++ trunk/tests/language-behaviour/foreach/title.txt	2011-06-16 18:03:24 UTC (rev 4623)
@@ -0,0 +1 @@
+Language-Behaviour Tests




More information about the Swift-commit mailing list