public void testIHasAMixedCaseIsNotSame() { CompilerState cs = new MockCompilerState(); cs.addVar("ALREADY"); IHasACommand cmd = (IHasACommand) CommandFactory.instance().getCommand("I HAS A ALreadY"); cmd.compile(cs); assertHasVar(cs, "ALreadY"); assertHasVar(cs, "ALREADY"); }
public void testIHasAAlready() { CompilerState cs = new MockCompilerState(); cs.addVar("ALREADY"); Command cmd = CommandFactory.instance().getCommand("I HAS A ALREADY"); try { cmd.compile(cs); fail("Should have thrown exception."); } catch (IdentifierAlreadyDeclaredException e) { // yay } }