public void testGetPutTypeRaw() { IntNat three = IntNat.make(3); IntNat a = IntNat.make((int) '$'); IntNat b = IntNat.make((int) 'K'); IntNat c = IntNat.make((int) 'l'); testCompiledEnv.putTypeRaw("Empty", three); testCompiledEnv.putTypeRaw("Empty" + '\u05D0', a); testCompiledEnv.putTypeRaw("Empty" + '\u05D1', b); testCompiledEnv.putTypeRaw("Empty" + '\u05D2', c); assertEquals(testCompiledEnv.getLeafTypeNull("Empty"), three); // leaf assertEquals(testCompiledEnv.getLeafTypeNull("Empty" + '\u05D0'), a); // leaf assertEquals(testCompiledEnv.getLeafTypeNull("Empty" + '\u05D1'), b); // leaf assertEquals(testCompiledEnv.getLeafTypeNull("Empty" + '\u05D2'), c); // leaf assertNull(testCompiledEnv.getLeafTypeNull("Chupacabra")); // leaf }
public void testRemoveMethods() { IntNat three = IntNat.make(3); testCompiledEnv.putTypeRaw("Empty", three); assertEquals(testCompiledEnv.getLeafTypeNull("Empty"), three); // leaf testCompiledEnv.removeType("Empty"); assertNull(testCompiledEnv.getLeafTypeNull("Empty")); // leaf FInt seven = FInt.make(7); testCompiledEnv.putValueRaw("run", seven); assertEquals(testCompiledEnv.getValueRaw("run"), seven); testCompiledEnv.removeVar("run"); assertNull(testCompiledEnv.getValueRaw("run")); }