[Swift-commit] r6160 - trunk/tests/language-behaviour/math

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Thu Jan 17 23:05:08 CST 2013


Author: davidk
Date: 2013-01-17 23:05:08 -0600 (Thu, 17 Jan 2013)
New Revision: 6160

Added:
   trunk/tests/language-behaviour/math/intdivision.out
   trunk/tests/language-behaviour/math/intdivision.out.expected
   trunk/tests/language-behaviour/math/intdivision.swift
Log:
Integer division test


Added: trunk/tests/language-behaviour/math/intdivision.out
===================================================================
--- trunk/tests/language-behaviour/math/intdivision.out	                        (rev 0)
+++ trunk/tests/language-behaviour/math/intdivision.out	2013-01-18 05:05:08 UTC (rev 6160)
@@ -0,0 +1 @@
+x = 1, y = 1, z = 1

Added: trunk/tests/language-behaviour/math/intdivision.out.expected
===================================================================
--- trunk/tests/language-behaviour/math/intdivision.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/math/intdivision.out.expected	2013-01-18 05:05:08 UTC (rev 6160)
@@ -0,0 +1,3 @@
+n = 1
+x = 1.0
+x = 1

Added: trunk/tests/language-behaviour/math/intdivision.swift
===================================================================
--- trunk/tests/language-behaviour/math/intdivision.swift	                        (rev 0)
+++ trunk/tests/language-behaviour/math/intdivision.swift	2013-01-18 05:05:08 UTC (rev 6160)
@@ -0,0 +1,13 @@
+type file;
+file outfile <"intdivision.out">;
+
+app (file o) echo (string s) {
+   echo s stdout=@o;
+}
+
+int x = 7 %/ 5;                    // expect x = 1
+float y = 1.0*@toFloat(x);         // expect y = 1.0
+string z = @strcat(y);             
+
+string msg = @strcat("x = ", x, ", y = ", y, ", z = ", z);
+outfile = echo(msg);




More information about the Swift-commit mailing list