You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2015/09/11 08:43:31 UTC

[4/4] git commit: [flex-falcon] [refs/heads/develop] - ignore 'Generated By' string in test output since it can have timestamps on the class name

ignore 'Generated By' string in test output since it can have timestamps on the class name


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

Branch: refs/heads/develop
Commit: d0a934eb6aa86548ea8da0737f5b5a5ed819c2e8
Parents: 7dc2630
Author: Alex Harui <ah...@apache.org>
Authored: Thu Sep 10 23:43:49 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Sep 10 23:43:49 2015 -0700

----------------------------------------------------------------------
 .../flex/compiler/internal/test/TestBase.java       | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d0a934eb/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java
index cd69242..ad0a401 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java
@@ -147,11 +147,24 @@ public class TestBase implements ITestBase
 
     protected void assertOut(String code)
     {
-        mCode = writer.toString();
+        mCode = removeGeneratedString(writer.toString());
         //System.out.println(mCode);
         assertThat(mCode, is(code));
     }
 
+    protected String removeGeneratedString(String code)
+    {
+    	int c = code.indexOf(" * Generated by Apache Flex Cross-Compiler");
+    	if (c != -1)
+    	{
+    		int c2 = code.indexOf("\n", c);
+    		String newString = code.substring(0, c);
+    		newString += code.substring(c2 + 1);
+    		return newString;
+    	}
+    	return code;
+    }
+    
     @Override
     public String toString()
     {
@@ -539,6 +552,7 @@ public class TestBase implements ITestBase
                 line = in.readLine();
             }
             code = code.substring(0, code.length() - 1);
+            code = removeGeneratedString(code);
 
             in.close();
         }