[Swift-commit] r5551 - trunk/tests/language-behaviour/arrays
davidk at ci.uchicago.edu
davidk at ci.uchicago.edu
Mon Feb 6 15:44:39 CST 2012
Author: davidk
Date: 2012-02-06 15:44:39 -0600 (Mon, 06 Feb 2012)
New Revision: 5551
Added:
trunk/tests/language-behaviour/arrays/nested_array1.out.expected
trunk/tests/language-behaviour/arrays/nested_array1.swift
trunk/tests/language-behaviour/arrays/nested_array2.out.expected
trunk/tests/language-behaviour/arrays/nested_array2.swift
trunk/tests/language-behaviour/arrays/nested_array3.out.expected
trunk/tests/language-behaviour/arrays/nested_array3.swift
Log:
Regression tests for bug #696
Added: trunk/tests/language-behaviour/arrays/nested_array1.out.expected
===================================================================
--- trunk/tests/language-behaviour/arrays/nested_array1.out.expected (rev 0)
+++ trunk/tests/language-behaviour/arrays/nested_array1.out.expected 2012-02-06 21:44:39 UTC (rev 5551)
@@ -0,0 +1 @@
+in sub: iap=[100,101]
Added: trunk/tests/language-behaviour/arrays/nested_array1.swift
===================================================================
--- trunk/tests/language-behaviour/arrays/nested_array1.swift (rev 0)
+++ trunk/tests/language-behaviour/arrays/nested_array1.swift 2012-02-06 21:44:39 UTC (rev 5551)
@@ -0,0 +1,34 @@
+type file;
+
+app (file o) echo (string input)
+{
+ echo input stdout=@o;
+}
+
+
+main()
+{
+ foreach i in [0:0] {
+ int ia[];
+ if(true) {
+ foreach j in [0:1] {
+ if (j==0) {
+ ia[j] = 100;
+ }
+ else {
+ ia[j] = 101;
+ }
+ }
+ sub(ia);
+ }
+ }
+}
+
+sub(int iap[])
+{
+ file f <"nested_array1.out">;
+ f = echo(@sprintf("in sub: iap=%q",iap));
+}
+
+main();
+
Added: trunk/tests/language-behaviour/arrays/nested_array2.out.expected
===================================================================
--- trunk/tests/language-behaviour/arrays/nested_array2.out.expected (rev 0)
+++ trunk/tests/language-behaviour/arrays/nested_array2.out.expected 2012-02-06 21:44:39 UTC (rev 5551)
@@ -0,0 +1 @@
+in sub: iap=[100,101]
Added: trunk/tests/language-behaviour/arrays/nested_array2.swift
===================================================================
--- trunk/tests/language-behaviour/arrays/nested_array2.swift (rev 0)
+++ trunk/tests/language-behaviour/arrays/nested_array2.swift 2012-02-06 21:44:39 UTC (rev 5551)
@@ -0,0 +1,30 @@
+type file;
+
+app (file o) echo (string input)
+{
+ echo input stdout=@o;
+}
+
+main()
+{
+ foreach i in [0:0] {
+ int ia[];
+ foreach j in [0:1] {
+ if (j==0) {
+ ia[j] = 100;
+ }
+ else {
+ ia[j] = 101;
+ }
+ }
+ sub(ia);
+ }
+}
+
+sub(int iap[])
+{
+ file f<"nested_array2.out">;
+ f = echo(@sprintf("in sub: iap=%q",iap));
+}
+
+main();
Added: trunk/tests/language-behaviour/arrays/nested_array3.out.expected
===================================================================
--- trunk/tests/language-behaviour/arrays/nested_array3.out.expected (rev 0)
+++ trunk/tests/language-behaviour/arrays/nested_array3.out.expected 2012-02-06 21:44:39 UTC (rev 5551)
@@ -0,0 +1 @@
+in sub: iap=[100,101]
Added: trunk/tests/language-behaviour/arrays/nested_array3.swift
===================================================================
--- trunk/tests/language-behaviour/arrays/nested_array3.swift (rev 0)
+++ trunk/tests/language-behaviour/arrays/nested_array3.swift 2012-02-06 21:44:39 UTC (rev 5551)
@@ -0,0 +1,32 @@
+type file;
+
+app (file o) echo (string input)
+{
+ echo input stdout=@o;
+}
+
+main()
+{
+ foreach i in [0:0] {
+ if(true) {
+ int ia[];
+ foreach j in [0:1] {
+ if (j==0) {
+ ia[j] = 100;
+ }
+ else {
+ ia[j] = 101;
+ }
+ }
+ sub(ia);
+ }
+ }
+}
+
+sub(int iap[])
+{
+ file f<"nested_array3.out">;
+ f = echo(@sprintf("in sub: iap=%q",iap));
+}
+
+main();
More information about the Swift-commit
mailing list