[Swift-commit] r2301 - trunk/tests/language-behaviour

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Wed Oct 15 05:28:14 CDT 2008


Author: benc
Date: 2008-10-15 05:28:13 -0500 (Wed, 15 Oct 2008)
New Revision: 2301

Added:
   trunk/tests/language-behaviour/readData2.in
   trunk/tests/language-behaviour/readData2.out.expected
   trunk/tests/language-behaviour/readData2.swift
Log:
readData2 test

Added: trunk/tests/language-behaviour/readData2.in
===================================================================
--- trunk/tests/language-behaviour/readData2.in	                        (rev 0)
+++ trunk/tests/language-behaviour/readData2.in	2008-10-15 10:28:13 UTC (rev 2301)
@@ -0,0 +1,6 @@
+rows[0].columns[0] = 0                                                          
+rows[0].columns[1] = 2                                                          
+rows[0].columns[2] = 4                                                          
+rows[1].columns[0] = 1                                                          
+rows[1].columns[1] = 3                                                          
+rows[1].columns[2] = 5 

Added: trunk/tests/language-behaviour/readData2.out.expected
===================================================================
--- trunk/tests/language-behaviour/readData2.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/readData2.out.expected	2008-10-15 10:28:13 UTC (rev 2301)
@@ -0,0 +1 @@
+15

Added: trunk/tests/language-behaviour/readData2.swift
===================================================================
--- trunk/tests/language-behaviour/readData2.swift	                        (rev 0)
+++ trunk/tests/language-behaviour/readData2.swift	2008-10-15 10:28:13 UTC (rev 2301)
@@ -0,0 +1,33 @@
+type vector {  
+   int columns[];   
+}    
+
+type matrix {  
+   vector rows[];   
+}    
+
+type file;
+
+(file o) echo(int s) {
+  app {
+    echo s stdout=@o;
+  }
+}
+
+
+matrix m; 
+
+m = readData2("readData2.in"); 
+
+int s;
+
+s = m.rows[0].columns[0] +
+        m.rows[0].columns[1] +
+        m.rows[0].columns[2] +
+        m.rows[1].columns[0] +
+        m.rows[1].columns[1] +
+        m.rows[1].columns[2] ; 
+
+file out <"readData2.out">;
+out = echo(s);
+




More information about the Swift-commit mailing list