flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [59/83] [abbrv] git commit: [flex-falcon] [refs/heads/develop] - ignore 'Generated By' string in test output since it can have timestamps on the class name
Date Fri, 25 Sep 2015 04:49:28 GMT
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/0b986345
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/0b986345
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/0b986345

Branch: refs/heads/develop
Commit: 0b9863459c129f861716b61d4e8e65eb7bb9c1a7
Parents: 31cb0e1
Author: Alex Harui <aharui@apache.org>
Authored: Thu Sep 10 23:43:49 2015 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Tue Sep 22 10:35:13 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/0b986345/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();
         }


Mime
View raw message