    1   package org.codehaus.groovy.syntax.parser;
    2
    3   import groovy.util.GroovyTestCase;
    4
    5   import org.codehaus.groovy.syntax.Token;
    6
    7   public class CSTNodeTest
    8       extends GroovyTestCase
    9   {
    10
    11      public void testNothing()
    12      {
    13      }
    14
    15  /*
    16      public void testConstruct_Default()
    17      {
    18          CSTNode node = new CSTNode();
    19
    20          assertNull( node.getToken() );
    21
    22          assertLength( 0,
    23                        node.getChildren() );
    24      }
    25
    26      public void testConstruct_WithToken()
    27      {
    28          Token token = Token.identifier( 1,
    29                                          1,
    30                                          "cheese" );
    31
    32          CSTNode node = new CSTNode( token );
    33
    34          assertSame( token,
    35                      node.getToken() );
    36
    37          assertLength( 0,
    38                        node.getChildren() );
    39      }
    40
    41      public void testChildren()
    42      {
    43          CSTNode node = new CSTNode();
    44
    45          CSTNode childOne = new CSTNode();
    46          CSTNode childTwo = new CSTNode();
    47
    48          node.addChild( childOne );
    49          node.addChild( childTwo );
    50
    51          assertLength( 2,
    52                        node.getChildren() );
    53
    54          assertSame( childOne,
    55                      node.getChild( 0 ) );
    56
    57          assertSame( childTwo,
    58                      node.getChild( 1 ) );
    59
    60          assertSame( childOne,
    61                      node.getChildren()[0] );
    62
    63          assertSame( childTwo,
    64                      node.getChildren()[1] );
    65      }
    66  */
    67  }