01: package org.codehaus.groovy.antlr;
02:
03: import groovy.util.GroovyTestCase;
04:
05: public class GroovySourceASTTest extends GroovyTestCase {
06: GroovySourceAST a;
07: GroovySourceAST b;
08:
09: protected void setUp() throws Exception {
10: a = new GroovySourceAST();
11: a.setLine(3);
12: a.setColumn(3);
13:
14: b = new GroovySourceAST();
15: b.setLine(4);
16: b.setColumn(2);
17: }
18:
19: public void testLessThan() throws Exception {
20: assertTrue(a.compareTo(b) < 0);
21: }
22:
23: public void testEquality() throws Exception {
24: assertTrue(a.equals(a));
25: assertTrue(a.compareTo(a) == 0);
26: }
27:
28: public void testGreaterThan() throws Exception {
29: assertTrue(b.compareTo(a) > 0);
30: }
31: }
|