flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joshtynj...@apache.org
Subject [3/4] git commit: [flex-falcon] [refs/heads/develop] - compiler.jx.tests: added tests for package-level functions and variables
Date Tue, 12 Jan 2016 21:11:59 GMT
compiler.jx.tests: added tests for package-level functions and variables


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/118764df
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/118764df
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/118764df

Branch: refs/heads/develop
Commit: 118764df7226dfa836610f11e0b87882f13742a6
Parents: 2d9c944
Author: Josh Tynjala <joshtynjala@apache.org>
Authored: Tue Jan 12 13:10:46 2016 -0800
Committer: Josh Tynjala <joshtynjala@apache.org>
Committed: Tue Jan 12 13:10:46 2016 -0800

----------------------------------------------------------------------
 .../codegen/js/flexjs/TestFlexJSPackage.java    | 32 ++++++++++++++++++++
 1 file changed, 32 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/118764df/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSPackage.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSPackage.java
b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSPackage.java
index 6469c6e..3d9fe41 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSPackage.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSPackage.java
@@ -502,6 +502,38 @@ public class TestFlexJSPackage extends TestGoogPackage
         		  " */\n" +
         		  "foo.bar.baz.A.InternalClass.prototype.FLEXJS_CLASS_INFO = { names: [{ name:
'InternalClass', qName: 'foo.bar.baz.A.InternalClass'}], interfaces: [foo.bar.baz.A.ITestInterface]
};\n");
     }
+
+	@Test
+	public void testPackageSimple_Function()
+	{
+		IFileNode node = compileAS("package {public function A(){}}");
+		asBlockWalker.visitFile(node);
+		assertOutWithMetadata("/**\n * A\n *\n * @fileoverview\n *\n * @suppress {checkTypes|accessControls}\n
*/\n\ngoog.provide('A');\n\n/**\n * @export\n */\nA = function() {\n}");
+	}
+
+	@Test
+	public void testPackageQualified_Function()
+	{
+		IFileNode node = compileAS("package foo.bar.baz {public function A(){}}");
+		asBlockWalker.visitFile(node);
+		assertOutWithMetadata("/**\n * foo.bar.baz.A\n *\n * @fileoverview\n *\n * @suppress {checkTypes|accessControls}\n
*/\n\ngoog.provide('foo.bar.baz.A');\n\n/**\n * @export\n */\nfoo.bar.baz.A = function() {\n}");
+	}
+
+	@Test
+	public void testPackageSimple_Variable()
+	{
+		IFileNode node = compileAS("package {public var A:String = \"Hello\";");
+		asBlockWalker.visitFile(node);
+		assertOutWithMetadata("/**\n * A\n *\n * @fileoverview\n *\n * @suppress {checkTypes|accessControls}\n
*/\n\ngoog.provide('A');\n\n/**\n * @export\n * @type {string}\n */\nA = \"Hello\"");
+	}
+
+	@Test
+	public void testPackageQualified_Variable()
+	{
+		IFileNode node = compileAS("package foo.bar.baz {public var A:String = \"Hello\";");
+		asBlockWalker.visitFile(node);
+		assertOutWithMetadata("/**\n * foo.bar.baz.A\n *\n * @fileoverview\n *\n * @suppress {checkTypes|accessControls}\n
*/\n\ngoog.provide('foo.bar.baz.A');\n\n/**\n * @export\n * @type {string}\n */\nfoo.bar.baz.A
= \"Hello\"");
+	}
     
     @Override
     protected IBackend createBackend()


Mime
View raw message