incubator-flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gordonsm...@apache.org
Subject svn commit: r1405234 - /incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLStringNodeTests.java
Date Sat, 03 Nov 2012 00:10:34 GMT
Author: gordonsmith
Date: Sat Nov  3 00:10:34 2012
New Revision: 1405234

URL: http://svn.apache.org/viewvc?rev=1405234&view=rev
Log:
Falcon: Added some nontrivial tests for parsing <String> tag.

Modified:
    incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLStringNodeTests.java

Modified: incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLStringNodeTests.java
URL: http://svn.apache.org/viewvc/incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLStringNodeTests.java?rev=1405234&r1=1405233&r2=1405234&view=diff
==============================================================================
--- incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLStringNodeTests.java
(original)
+++ incubator/flex/falcon/trunk/compiler.tests/unit-tests/org/apache/flex/compiler/internal/tree/mxml/MXMLStringNodeTests.java
Sat Nov  3 00:10:34 2012
@@ -25,6 +25,7 @@ import static org.junit.Assert.assertTha
 import org.apache.flex.compiler.tree.ASTNodeID;
 import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
 import org.apache.flex.compiler.tree.mxml.IMXMLStringNode;
+import org.junit.Ignore;
 import org.junit.Test;
 
 /**
@@ -71,6 +72,61 @@ public class MXMLStringNodeTests extends
 	}
 	
 	@Test
+	public void MXMLStringNode_text()
+	{
+		String code = "<fx:String>abc</fx:String>";
+		IMXMLStringNode node = getMXMLStringNode(code);
+		assertThat("getValue", node.getValue(), is("abc"));
+		testExpressionLocation(node, 11, 14);
+	}
+	
+	@Test
+	public void MXMLStringNode_text_with_whitespace()
+	{
+		String code = "<fx:String> a b c </fx:String>";
+		IMXMLStringNode node = getMXMLStringNode(code);
+		assertThat("getValue", node.getValue(), is(" a b c "));
+		testExpressionLocation(node, 11, 18);
+	}
+	
+	@Test
+	public void MXMLStringNode_numeric()
+	{
+		String code = "<fx:String>123</fx:String>";
+		IMXMLStringNode node = getMXMLStringNode(code);
+		assertThat("getValue", node.getValue(), is("123"));
+		testExpressionLocation(node, 11, 14);
+	}
+	
+	@Test
+	public void MXMLStringNode_true()
+	{
+		String code = "<fx:String>true</fx:String>";
+		IMXMLStringNode node = getMXMLStringNode(code);
+		assertThat("getValue", node.getValue(), is("true"));
+		testExpressionLocation(node, 11, 15);
+	}
+	
+	@Test
+	public void MXMLStringNode_entities()
+	{
+		String code = "<fx:String>&#x41;&#x42;&#x43;</fx:String>";
+		IMXMLStringNode node = getMXMLStringNode(code);
+		assertThat("getValue", node.getValue(), is("ABC"));
+		testExpressionLocation(node, 11, 29);
+	}
+	
+	@Ignore
+	@Test
+	public void MXMLStringNode_CDATA()
+	{
+		String code = "<fx:String><![CDATA[a]]><![CDATA[b]]><![CDATA[c]]></fx:String>";
+		IMXMLStringNode node = getMXMLStringNode(code);
+		assertThat("getValue", node.getValue(), is("abc"));
+		testExpressionLocation(node, 11, 50);
+	}
+	
+	@Test
 	public void MXMLStringNode_with_databinding()
 	{
 		String code = "<fx:String>{a.b}</fx:String>";



Mime
View raw message