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 <[email protected]>
Authored: Thu Sep 10 23:43:49 2015 -0700
Committer: Alex Harui <[email protected]>
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();
         }

Reply via email to