[Swift-commit] r2595 - in trunk/tests/language: working working-base

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Mon Feb 23 09:10:13 CST 2009


Author: benc
Date: 2009-02-23 09:10:12 -0600 (Mon, 23 Feb 2009)
New Revision: 2595

Added:
   trunk/tests/language/working-base/escapes.xml
   trunk/tests/language/working-base/operators.xml
   trunk/tests/language/working-base/underscore-in-id.xml
   trunk/tests/language/working/escapes.swift
   trunk/tests/language/working/operators.swift
   trunk/tests/language/working/underscore-in-id.swift
Modified:
   trunk/tests/language/working-base/struct1.xml
   trunk/tests/language/working/struct1.swift
Log:
Additional tests for the lexer (based on information from EMMA coverage test)

Added: trunk/tests/language/working/escapes.swift
===================================================================
--- trunk/tests/language/working/escapes.swift	                        (rev 0)
+++ trunk/tests/language/working/escapes.swift	2009-02-23 15:10:12 UTC (rev 2595)
@@ -0,0 +1,16 @@
+
+string s = "\n";
+
+string t = "\r";
+
+string u = "\t";
+
+string v = "\b";
+
+string w = "\f";
+
+string x = "\"";
+
+string y = "\'";
+
+string z = "\\";

Added: trunk/tests/language/working/operators.swift
===================================================================
--- trunk/tests/language/working/operators.swift	                        (rev 0)
+++ trunk/tests/language/working/operators.swift	2009-02-23 15:10:12 UTC (rev 2595)
@@ -0,0 +1,5 @@
+
+boolean a = (1 != 2);
+
+int b = +3;
+

Modified: trunk/tests/language/working/struct1.swift
===================================================================
--- trunk/tests/language/working/struct1.swift	2009-02-23 15:06:32 UTC (rev 2594)
+++ trunk/tests/language/working/struct1.swift	2009-02-23 15:10:12 UTC (rev 2595)
@@ -4,3 +4,11 @@
   int c;
   int d;
 }
+
+type bar {
+  int a;
+  int b[], c, d[], e, f, g[];
+  int h, i[];
+  int j;
+  int k;
+}

Added: trunk/tests/language/working/underscore-in-id.swift
===================================================================
--- trunk/tests/language/working/underscore-in-id.swift	                        (rev 0)
+++ trunk/tests/language/working/underscore-in-id.swift	2009-02-23 15:10:12 UTC (rev 2595)
@@ -0,0 +1,2 @@
+
+int a_b_c = 3;

Added: trunk/tests/language/working-base/escapes.xml
===================================================================
--- trunk/tests/language/working-base/escapes.xml	                        (rev 0)
+++ trunk/tests/language/working-base/escapes.xml	2009-02-23 15:10:12 UTC (rev 2595)
@@ -0,0 +1,44 @@
+<program xmlns="http://ci.uchicago.edu/swift/2009/02/swiftscript"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xmlns:xs="http://www.w3.org/2001/XMLSchema">
+  <variable name="s" type="string" xsi:nil="true"/>
+  <assign src="line 4">
+   <variableReference>s</variableReference>
+   <stringConstant>\n</stringConstant>
+  </assign>
+  <variable name="t" type="string" xsi:nil="true"/>
+  <assign src="line 6">
+   <variableReference>t</variableReference>
+   <stringConstant>\r</stringConstant>
+  </assign>
+  <variable name="u" type="string" xsi:nil="true"/>
+  <assign src="line 8">
+   <variableReference>u</variableReference>
+   <stringConstant>\t</stringConstant>
+  </assign>
+  <variable name="v" type="string" xsi:nil="true"/>
+  <assign src="line 10">
+   <variableReference>v</variableReference>
+   <stringConstant>\b</stringConstant>
+  </assign>
+  <variable name="w" type="string" xsi:nil="true"/>
+  <assign src="line 12">
+   <variableReference>w</variableReference>
+   <stringConstant>\f</stringConstant>
+  </assign>
+  <variable name="x" type="string" xsi:nil="true"/>
+  <assign src="line 14">
+   <variableReference>x</variableReference>
+   <stringConstant>"</stringConstant>
+  </assign>
+  <variable name="y" type="string" xsi:nil="true"/>
+  <assign src="line 16">
+   <variableReference>y</variableReference>
+   <stringConstant>\'</stringConstant>
+  </assign>
+  <variable name="z" type="string" xsi:nil="true"/>
+  <assign src="line 17">
+   <variableReference>z</variableReference>
+   <stringConstant>\</stringConstant>
+  </assign>
+</program>

Added: trunk/tests/language/working-base/operators.xml
===================================================================
--- trunk/tests/language/working-base/operators.xml	                        (rev 0)
+++ trunk/tests/language/working-base/operators.xml	2009-02-23 15:10:12 UTC (rev 2595)
@@ -0,0 +1,17 @@
+<program xmlns="http://ci.uchicago.edu/swift/2009/02/swiftscript"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xmlns:xs="http://www.w3.org/2001/XMLSchema">
+  <variable name="a" type="boolean" xsi:nil="true"/>
+  <assign src="line 4">
+   <variableReference>a</variableReference>
+   <cond op="!=">
+     <integerConstant>1</integerConstant>
+     <integerConstant>2</integerConstant>
+   </cond>
+  </assign>
+  <variable name="b" type="int" xsi:nil="true"/>
+  <assign src="line 6">
+   <variableReference>b</variableReference>
+   <integerConstant>3</integerConstant>
+  </assign>
+</program>

Modified: trunk/tests/language/working-base/struct1.xml
===================================================================
--- trunk/tests/language/working-base/struct1.xml	2009-02-23 15:06:32 UTC (rev 2594)
+++ trunk/tests/language/working-base/struct1.xml	2009-02-23 15:10:12 UTC (rev 2595)
@@ -24,6 +24,56 @@
      					<membertype>int</membertype>
      				</member>
      		</typestructure>
+     	</type>
+     	<type>
+     		<typename>bar</typename>
+     		<typealias></typealias>
+     		<typestructure>
+     			    <member>
+     					<membername>a</membername>
+     					<membertype>int</membertype>
+     				</member>
+     			    <member>
+     					<membername>b</membername>
+     					<membertype>int[]</membertype>
+     				</member>
+     			    <member>
+     					<membername>c</membername>
+     					<membertype>int</membertype>
+     				</member>
+     			    <member>
+     					<membername>d</membername>
+     					<membertype>int[]</membertype>
+     				</member>
+     			    <member>
+     					<membername>e</membername>
+     					<membertype>int</membertype>
+     				</member>
+     			    <member>
+     					<membername>f</membername>
+     					<membertype>int</membertype>
+     				</member>
+     			    <member>
+     					<membername>g</membername>
+     					<membertype>int[]</membertype>
+     				</member>
+     			    <member>
+     					<membername>h</membername>
+     					<membertype>int</membertype>
+     				</member>
+     			    <member>
+     					<membername>i</membername>
+     					<membertype>int[]</membertype>
+     				</member>
+     			    <member>
+     					<membername>j</membername>
+     					<membertype>int</membertype>
+     				</member>
+     			    <member>
+     					<membername>k</membername>
+     					<membertype>int</membertype>
+     				</member>
+     		</typestructure>
      	</type>   
   </types>  
 </program>

Added: trunk/tests/language/working-base/underscore-in-id.xml
===================================================================
--- trunk/tests/language/working-base/underscore-in-id.xml	                        (rev 0)
+++ trunk/tests/language/working-base/underscore-in-id.xml	2009-02-23 15:10:12 UTC (rev 2595)
@@ -0,0 +1,9 @@
+<program xmlns="http://ci.uchicago.edu/swift/2009/02/swiftscript"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xmlns:xs="http://www.w3.org/2001/XMLSchema">
+  <variable name="a_b_c" type="int" xsi:nil="true"/>
+  <assign src="line 3">
+   <variableReference>a_b_c</variableReference>
+   <integerConstant>3</integerConstant>
+  </assign>
+</program>




More information about the Swift-commit mailing list