[Swift-commit] r4560 - trunk/tests/functions

wozniak at ci.uchicago.edu wozniak at ci.uchicago.edu
Fri Jun 3 14:13:53 CDT 2011


Author: wozniak
Date: 2011-06-03 14:13:53 -0500 (Fri, 03 Jun 2011)
New Revision: 4560

Added:
   trunk/tests/functions/450-tracef.check.sh
Modified:
   trunk/tests/functions/450-tracef.swift
Log:
Update tracef() tests


Added: trunk/tests/functions/450-tracef.check.sh
===================================================================
--- trunk/tests/functions/450-tracef.check.sh	                        (rev 0)
+++ trunk/tests/functions/450-tracef.check.sh	2011-06-03 19:13:53 UTC (rev 4560)
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+set -x
+
+grep "int:3:3"                 stdout.txt || exit 1
+grep "string:4:4"              stdout.txt || exit 1
+grep "fraction:3.14"           stdout.txt || exit 1
+grep "file:file:.*/test.txt"   stdout.txt || exit 1
+grep "array:\[9.0,91.0,19.0\]" stdout.txt || exit 1
+grep "pointer:.*Closed"        stdout.txt || exit 1
+
+[[ $( grep -c "WORD" stdout.txt ) == 2 ]] || exit 1
+[[ $( grep "WORD" stdout.txt | wc -w ) == 5 ]] || exit 1
+
+exit 0


Property changes on: trunk/tests/functions/450-tracef.check.sh
___________________________________________________________________
Added: svn:executable
   + *

Modified: trunk/tests/functions/450-tracef.swift
===================================================================
--- trunk/tests/functions/450-tracef.swift	2011-06-03 19:10:23 UTC (rev 4559)
+++ trunk/tests/functions/450-tracef.swift	2011-06-03 19:13:53 UTC (rev 4560)
@@ -1,4 +1,20 @@
 
-tracef("3:%i\n", 3);
-tracef("4:%s\n", "4");
+tracef("int:3:%i\n", 3);
+tracef("string:4:%s\n", "4");
 tracef("fraction:%f\n", 22.0/7.0);
+
+type file;
+file f<"test.txt">;
+tracef("file:%M\n", f);
+
+int i[];
+i[0] = 9;
+i[1] = 91;
+i[2] = 19;
+tracef("array:%q\n", i);
+
+tracef("pointer:%p\n", 3);
+tracef("spacing: WORD\tWORD\nWORD\tWORD\n");
+
+// TODO: Debug the Swift parser- it handles backslash strangely
+// tracef("backslash2: \\ \ qq \\\\ \\n");




More information about the Swift-commit mailing list