1 17 18 package org.sablecc.sablecc.launcher; 19 20 import static org.junit.Assert.assertEquals; 21 import static org.junit.Assert.fail; 22 23 import org.junit.Test; 24 import org.sablecc.sablecc.exception.InternalException; 25 26 public class TextArgumentTest { 27 28 TextArgument textArgument; 29 30 String text; 31 32 @Test 33 public void testTextArgument() { 34 35 this.text = null; 37 try { 38 this.textArgument = new TextArgument(this.text); 39 fail("text may not be null"); 40 } 41 catch (InternalException e) { 42 } 44 45 this.text = "new text"; 47 this.textArgument = new TextArgument(this.text); 48 assertEquals("the text argument does not contain the good text", 49 this.text, this.textArgument.getText()); 50 } 51 52 } 53 | Popular Tags |