[Swift-commit] r4418 - in trunk/tests: . language-behaviour
davidk at ci.uchicago.edu
davidk at ci.uchicago.edu
Tue Apr 26 01:55:46 CDT 2011
Author: davidk
Date: 2011-04-26 01:55:46 -0500 (Tue, 26 Apr 2011)
New Revision: 4418
Added:
trunk/tests/language-behaviour/057-foreach-twice-range.check.sh
trunk/tests/language-behaviour/057-foreach-twice-range.clean.sh
trunk/tests/language-behaviour/057-foreach-twice-range.first.0000.out.expected
trunk/tests/language-behaviour/057-foreach-twice-range.first.0001.out.expected
trunk/tests/language-behaviour/057-foreach-twice-range.first.0002.out.expected
trunk/tests/language-behaviour/057-foreach-twice-range.first.0003.out.expected
trunk/tests/language-behaviour/057-foreach-twice-range.first.0004.out.expected
trunk/tests/language-behaviour/057-foreach-twice-range.first.0005.out.expected
trunk/tests/language-behaviour/057-foreach-twice-range.first.0006.out.expected
trunk/tests/language-behaviour/057-foreach-twice-range.first.0007.out.expected
trunk/tests/language-behaviour/057-foreach-twice-range.first.0008.out.expected
trunk/tests/language-behaviour/057-foreach-twice-range.first.0009.out.expected
trunk/tests/language-behaviour/057-foreach-twice-range.second.0000.out.expected
trunk/tests/language-behaviour/057-foreach-twice-range.second.0001.out.expected
trunk/tests/language-behaviour/057-foreach-twice-range.second.0002.out.expected
trunk/tests/language-behaviour/057-foreach-twice-range.second.0003.out.expected
trunk/tests/language-behaviour/057-foreach-twice-range.second.0004.out.expected
trunk/tests/language-behaviour/057-foreach-twice-range.second.0005.out.expected
trunk/tests/language-behaviour/057-foreach-twice-range.second.0006.out.expected
trunk/tests/language-behaviour/057-foreach-twice-range.second.0007.out.expected
trunk/tests/language-behaviour/057-foreach-twice-range.second.0008.out.expected
trunk/tests/language-behaviour/057-foreach-twice-range.second.0009.out.expected
trunk/tests/language-behaviour/057-foreach-twice-range.setup.sh
trunk/tests/language-behaviour/057-foreach-twice-range.swift
trunk/tests/language-behaviour/058-foreach-twice-string.check.sh
trunk/tests/language-behaviour/058-foreach-twice-string.clean.sh
trunk/tests/language-behaviour/058-foreach-twice-string.first.0000.out.expected
trunk/tests/language-behaviour/058-foreach-twice-string.first.0001.out.expected
trunk/tests/language-behaviour/058-foreach-twice-string.first.0002.out.expected
trunk/tests/language-behaviour/058-foreach-twice-string.second.0000.out.expected
trunk/tests/language-behaviour/058-foreach-twice-string.second.0001.out.expected
trunk/tests/language-behaviour/058-foreach-twice-string.second.0002.out.expected
trunk/tests/language-behaviour/058-foreach-twice-string.setup.sh
trunk/tests/language-behaviour/058-foreach-twice-string.swift
Modified:
trunk/tests/suite.sh
Log:
Added more thorough regression tests for foreach bug (bugzilla #331)
Fixed a syntax error in the test suite script
Added: trunk/tests/language-behaviour/057-foreach-twice-range.check.sh
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.check.sh (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.check.sh 2011-04-26 06:55:46 UTC (rev 4418)
@@ -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/057-foreach-twice-range.check.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/tests/language-behaviour/057-foreach-twice-range.clean.sh
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.clean.sh (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.clean.sh 2011-04-26 06:55:46 UTC (rev 4418)
@@ -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/057-foreach-twice-range.clean.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/tests/language-behaviour/057-foreach-twice-range.first.0000.out.expected
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.first.0000.out.expected (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.first.0000.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+test1-0
Added: trunk/tests/language-behaviour/057-foreach-twice-range.first.0001.out.expected
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.first.0001.out.expected (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.first.0001.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+test1-1
Added: trunk/tests/language-behaviour/057-foreach-twice-range.first.0002.out.expected
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.first.0002.out.expected (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.first.0002.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+test1-2
Added: trunk/tests/language-behaviour/057-foreach-twice-range.first.0003.out.expected
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.first.0003.out.expected (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.first.0003.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+test1-3
Added: trunk/tests/language-behaviour/057-foreach-twice-range.first.0004.out.expected
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.first.0004.out.expected (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.first.0004.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+test1-4
Added: trunk/tests/language-behaviour/057-foreach-twice-range.first.0005.out.expected
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.first.0005.out.expected (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.first.0005.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+test1-5
Added: trunk/tests/language-behaviour/057-foreach-twice-range.first.0006.out.expected
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.first.0006.out.expected (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.first.0006.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+test1-6
Added: trunk/tests/language-behaviour/057-foreach-twice-range.first.0007.out.expected
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.first.0007.out.expected (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.first.0007.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+test1-7
Added: trunk/tests/language-behaviour/057-foreach-twice-range.first.0008.out.expected
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.first.0008.out.expected (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.first.0008.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+test1-8
Added: trunk/tests/language-behaviour/057-foreach-twice-range.first.0009.out.expected
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.first.0009.out.expected (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.first.0009.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+test1-9
Added: trunk/tests/language-behaviour/057-foreach-twice-range.second.0000.out.expected
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.second.0000.out.expected (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.second.0000.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+test2-0
Added: trunk/tests/language-behaviour/057-foreach-twice-range.second.0001.out.expected
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.second.0001.out.expected (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.second.0001.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+test2-1
Added: trunk/tests/language-behaviour/057-foreach-twice-range.second.0002.out.expected
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.second.0002.out.expected (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.second.0002.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+test2-2
Added: trunk/tests/language-behaviour/057-foreach-twice-range.second.0003.out.expected
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.second.0003.out.expected (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.second.0003.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+test2-3
Added: trunk/tests/language-behaviour/057-foreach-twice-range.second.0004.out.expected
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.second.0004.out.expected (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.second.0004.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+test2-4
Added: trunk/tests/language-behaviour/057-foreach-twice-range.second.0005.out.expected
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.second.0005.out.expected (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.second.0005.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+test2-5
Added: trunk/tests/language-behaviour/057-foreach-twice-range.second.0006.out.expected
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.second.0006.out.expected (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.second.0006.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+test2-6
Added: trunk/tests/language-behaviour/057-foreach-twice-range.second.0007.out.expected
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.second.0007.out.expected (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.second.0007.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+test2-7
Added: trunk/tests/language-behaviour/057-foreach-twice-range.second.0008.out.expected
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.second.0008.out.expected (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.second.0008.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+test2-8
Added: trunk/tests/language-behaviour/057-foreach-twice-range.second.0009.out.expected
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.second.0009.out.expected (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.second.0009.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+test2-9
Added: trunk/tests/language-behaviour/057-foreach-twice-range.setup.sh
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.setup.sh (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.setup.sh 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+cp -v $GROUP/057*expected . || exit 1
Property changes on: trunk/tests/language-behaviour/057-foreach-twice-range.setup.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/tests/language-behaviour/057-foreach-twice-range.swift
===================================================================
--- trunk/tests/language-behaviour/057-foreach-twice-range.swift (rev 0)
+++ trunk/tests/language-behaviour/057-foreach-twice-range.swift 2011-04-26 06:55:46 UTC (rev 4418)
@@ -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/058-foreach-twice-string.check.sh
===================================================================
--- trunk/tests/language-behaviour/058-foreach-twice-string.check.sh (rev 0)
+++ trunk/tests/language-behaviour/058-foreach-twice-string.check.sh 2011-04-26 06:55:46 UTC (rev 4418)
@@ -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/058-foreach-twice-string.check.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/tests/language-behaviour/058-foreach-twice-string.clean.sh
===================================================================
--- trunk/tests/language-behaviour/058-foreach-twice-string.clean.sh (rev 0)
+++ trunk/tests/language-behaviour/058-foreach-twice-string.clean.sh 2011-04-26 06:55:46 UTC (rev 4418)
@@ -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/058-foreach-twice-string.clean.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/tests/language-behaviour/058-foreach-twice-string.first.0000.out.expected
===================================================================
--- trunk/tests/language-behaviour/058-foreach-twice-string.first.0000.out.expected (rev 0)
+++ trunk/tests/language-behaviour/058-foreach-twice-string.first.0000.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+zero
Added: trunk/tests/language-behaviour/058-foreach-twice-string.first.0001.out.expected
===================================================================
--- trunk/tests/language-behaviour/058-foreach-twice-string.first.0001.out.expected (rev 0)
+++ trunk/tests/language-behaviour/058-foreach-twice-string.first.0001.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+one
Added: trunk/tests/language-behaviour/058-foreach-twice-string.first.0002.out.expected
===================================================================
--- trunk/tests/language-behaviour/058-foreach-twice-string.first.0002.out.expected (rev 0)
+++ trunk/tests/language-behaviour/058-foreach-twice-string.first.0002.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+two
Added: trunk/tests/language-behaviour/058-foreach-twice-string.second.0000.out.expected
===================================================================
--- trunk/tests/language-behaviour/058-foreach-twice-string.second.0000.out.expected (rev 0)
+++ trunk/tests/language-behaviour/058-foreach-twice-string.second.0000.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+zero
Added: trunk/tests/language-behaviour/058-foreach-twice-string.second.0001.out.expected
===================================================================
--- trunk/tests/language-behaviour/058-foreach-twice-string.second.0001.out.expected (rev 0)
+++ trunk/tests/language-behaviour/058-foreach-twice-string.second.0001.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+one
Added: trunk/tests/language-behaviour/058-foreach-twice-string.second.0002.out.expected
===================================================================
--- trunk/tests/language-behaviour/058-foreach-twice-string.second.0002.out.expected (rev 0)
+++ trunk/tests/language-behaviour/058-foreach-twice-string.second.0002.out.expected 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1 @@
+two
Added: trunk/tests/language-behaviour/058-foreach-twice-string.setup.sh
===================================================================
--- trunk/tests/language-behaviour/058-foreach-twice-string.setup.sh (rev 0)
+++ trunk/tests/language-behaviour/058-foreach-twice-string.setup.sh 2011-04-26 06:55:46 UTC (rev 4418)
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+cp -v $GROUP/058*expected . || exit 1
Property changes on: trunk/tests/language-behaviour/058-foreach-twice-string.setup.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/tests/language-behaviour/058-foreach-twice-string.swift
===================================================================
--- trunk/tests/language-behaviour/058-foreach-twice-string.swift (rev 0)
+++ trunk/tests/language-behaviour/058-foreach-twice-string.swift 2011-04-26 06:55:46 UTC (rev 4418)
@@ -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);
+}
+
Modified: trunk/tests/suite.sh
===================================================================
--- trunk/tests/suite.sh 2011-04-25 22:35:37 UTC (rev 4417)
+++ trunk/tests/suite.sh 2011-04-26 06:55:46 UTC (rev 4418)
@@ -950,7 +950,7 @@
if [[ -f $GROUPARG ]]; then
GROUPLISTFILE=$GROUPARG
source $GROUPLISTFILE || exit 1
-elif [[ -d $GROUPARG
+elif [[ -d $GROUPARG ]]; then
GROUPLIST=( $GROUPARG )
else
echo "Unusable GROUP argument: $GROUPARG"
More information about the Swift-commit
mailing list