<html>
<head>
<style><!--
body {background-color:#ffffff;}
.file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
.pathname {font-family:monospace; float:right;}
.fileheader {margin-bottom:.5em;}
.diff {margin:0;}
.tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
.tasklist ul {margin-top:0;margin-bottom:0;}
tr.alt {background-color:#eeeeee}
#added {background-color:#ddffdd;}
#addedchars {background-color:#99ff99;font-weight:bolder;}
tr.alt #added {background-color:#ccf7cc;}
#removed {background-color:#ffdddd;}
#removedchars {background-color:#ff9999;font-weight:bolder;}
tr.alt #removed {background-color:#f7cccc;}
#copied {background-color:#ccccff;}
tr.alt #copied {background-color:#bbbbf7;}
#info {color:#888888;}
#context {background-color:#eeeeee;}
td {padding-left:.3em;padding-right:.3em;}
tr.head {border-bottom-width:1px;border-bottom-style:solid;}
tr.head td {padding:0;padding-top:.2em;}
.task {background-color:#ffff00;}
.comment {white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:pre-wrap;word-wrap:break-word;padding:4px;border:1px dashed #000000;background-color:#ffffdd}
.error {color:red;}
hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="5">Commit in <b><tt>metaas/trunk/src/test/java/uk/co/badgersinfoil/metaas</tt></b></td></tr>
<tr><td><tt><a href="#file1">CodeMirror.java</a></tt> </td><td></td><td align="right" id="added">+18</td><td align="right" id="removed">-6</td><td nowrap="nowrap" align="center">533 -> 534</td></tr>
</table>
<pre class="comment">
Small improvements to test support code. Expose assertions for external use.
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname">metaas/trunk/src/test/java/uk/co/badgersinfoil/metaas</span><br />
<div class="fileheader"><big><b>CodeMirror.java</b></big> <small id="info">533 -> 534</small></div>
<pre class="diff"><small id="info">--- trunk/src/test/java/uk/co/badgersinfoil/metaas/CodeMirror.java        2007-10-02 22:59:13 UTC (rev 533)
+++ trunk/src/test/java/uk/co/badgersinfoil/metaas/CodeMirror.java        2007-10-06 23:12:10 UTC (rev 534)
@@ -5,10 +5,12 @@
</small></pre><pre class="diff" id="context"> import java.io.StringWriter;
import java.util.HashSet;
import java.util.Set;
</pre><pre class="diff" id="added">+import org.asdt.core.internal.antlr.AS3Parser;
</pre><pre class="diff" id="context"> import uk.co.badgersinfoil.metaas.dom.ASCompilationUnit;
import uk.co.badgersinfoil.metaas.impl.ASTASCompilationUnit;
import uk.co.badgersinfoil.metaas.impl.ASTIterator;
import uk.co.badgersinfoil.metaas.impl.ASTUtils;
</pre><pre class="diff" id="added">+import uk.co.badgersinfoil.metaas.impl.antlr.ASTDot;
</pre><pre class="diff" id="context"> import uk.co.badgersinfoil.metaas.impl.antlr.LinkedListToken;
import uk.co.badgersinfoil.metaas.impl.antlr.LinkedListTree;
import junit.framework.Assert;
</pre><pre class="diff"><small id="info">@@ -22,20 +24,28 @@
</small></pre><pre class="diff" id="context">          * finally asserting that the first string and the second string of
         * source code are the same.
         */
</pre><pre class="diff" id="removed">-        public static ASCompilationUnit assertReflection(ActionScriptFactory fact, ASCompilationUnit unit) <span id="removedchars">throws IOException </span>{
</pre><pre class="diff" id="added">+        public static ASCompilationUnit assertReflection(ActionScriptFactory fact, ASCompilationUnit unit) {
</pre><pre class="diff" id="context">                 LinkedListTree ast = ((ASTASCompilationUnit)unit).getAST();
                saintyCheckTokenStream(ast);
                saintyCheckStartStopTokens(ast);
                assertTokenStreamNotDisjoint(ast);
                StringWriter out = new StringWriter();
                ActionScriptWriter writer = fact.newWriter();
</pre><pre class="diff" id="removed">-                writer.write(out, unit);
</pre><pre class="diff" id="context">                 try {
</pre><pre class="diff" id="added">+                        writer.write(out, unit);
+                } catch (IOException e) {
+                        throw new Error(e);
+                }
+                try {
</pre><pre class="diff" id="context">                         ASCompilationUnit unit2 = fact.newParser().parse(new StringReader(out.toString()));
                        LinkedListTree ast2 = ((ASTASCompilationUnit)unit2).getAST();
                        assertASTMatch(ast, ast2);
                        StringWriter out2 = new StringWriter();
</pre><pre class="diff" id="removed">-                        writer.write(out2, unit2);
</pre><pre class="diff" id="added">+                        try {
+                                writer.write(out2, unit2);
+                        } catch (IOException e) {
+                                throw new Error(e);
+                        }
</pre><pre class="diff" id="context">                         Assert.assertEquals(out.toString(), out2.toString());
                        return unit2;
                } catch (SyntaxException e) {
</pre><pre class="diff"><small id="info">@@ -44,7 +54,7 @@
</small></pre><pre class="diff" id="context">                 }
        }
</pre><pre class="diff" id="removed">-        p<span id="removedchars">rivate</span> static Set assertTokenStreamNotDisjoint(LinkedListTree ast) {
</pre><pre class="diff" id="added">+        p<span id="addedchars">ublic</span> static Set assertTokenStreamNotDisjoint(LinkedListTree ast) {
</pre><pre class="diff" id="context">                 Set tokensFromStartToStop = tokenStreamToSet(ast);
                for (int i=0; i<ast.getChildCount(); i++) {
                        LinkedListTree child = (LinkedListTree)ast.getChild(i);
</pre><pre class="diff"><small id="info">@@ -67,10 +77,12 @@
</small></pre><pre class="diff" id="context">                 return tokens;
        }
</pre><pre class="diff" id="removed">-        p<span id="removedchars">rivate</span> static void assertASTMatch(LinkedListTree ast1, LinkedListTree ast2) {
</pre><pre class="diff" id="added">+        p<span id="addedchars">ublic</span> static void assertASTMatch(LinkedListTree ast1, LinkedListTree ast2) {
</pre><pre class="diff" id="context">                 String path = pathTo(ast1);
                ASTUtils.assertAS3TokenTypeIs("At "+path, ast1.getType(), ast2.getType());
</pre><pre class="diff" id="removed">-                Assert.assertEquals("At "+path, ast1.getText(), ast2.getText());
</pre><pre class="diff" id="added">+                if (ast1.getType() == AS3Parser.IDENT) {
+                        Assert.assertEquals("At "+path, ast1.getText(), ast2.getText());
+                }
</pre><pre class="diff" id="context">                 Assert.assertEquals("At "+path+" child count mismatch: "+stringifyFirstLevel(ast1)+" vs. "+stringifyFirstLevel(ast2),
                 ast1.getChildCount(), ast2.getChildCount());
                for (int i=0; i<ast1.getChildCount(); i++) {
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -> email">CVSspam</a> 0.2.12</small></center>
</body></html>