public void testIHasAWithValue() { CompilerState cs = new MockCompilerState(); IHasACommand cmd = (IHasACommand) CommandFactory.instance().getCommand("I HAS A FISH ITZ 4"); cmd.compile(cs); assertHasVar(cs, "FISH"); assertNotNull(cmd.getExpression()); assertInstanceOf(cmd.getExpression(), ValueExpression.class); assertEquals("4", cmd.getExpression().evaluate().strVal()); }
public void testIHasAMixedCase() { CompilerState cs = new MockCompilerState(); IHasACommand cmd = (IHasACommand) CommandFactory.instance().getCommand("I HAS A FisH"); cmd.compile(cs); assertHasVar(cs, "FisH"); assertNull(cmd.getExpression()); }