Esempio n. 1
0
 @Test
 public void testMakeHashTableNotDefinedKeyword() {
   try {
     evaluateString("(make-hash-table :test 'eq :test1 5)");
   } catch (Exception e) {
     Assert.assertEquals("(error \"Invalid argument list\" :test1)", TestSetup.getCause(e));
     return;
   }
   Assert.fail();
 }
Esempio n. 2
0
 @Test
 public void testMakeHashTableNotDefinedAction() {
   try {
     evaluateString("(make-hash-table :test 'a)");
   } catch (Exception e) {
     Assert.assertEquals("(error \"Invalid hash table test\" a)", TestSetup.getCause(e));
     return;
   }
   Assert.fail();
 }
Esempio n. 3
0
 @Test
 public void testMakeHashTableTestNotSymbol() {
   try {
     evaluateString("(make-hash-table :test 5 :test 'eql)");
   } catch (Exception e) {
     Assert.assertEquals("'(wrong-type-argument symbolp 5)", TestSetup.getCause(e));
     return;
   }
   Assert.fail();
 }
Esempio n. 4
0
 @Test
 public void testMapHashWrongTest() {
   try {
     evaluateString("(makehash 'a)");
   } catch (Exception e) {
     Assert.assertEquals("(error \"Invalid hash table test\" a)", TestSetup.getCause(e));
     return;
   }
   Assert.fail();
 }
Esempio n. 5
0
 @Test
 public void testMakeHashTableSizeNotInt() {
   try {
     evaluateString("(make-hash-table :size 10.0)");
   } catch (Exception e) {
     Assert.assertEquals("(error \"Invalid hash table size\" 10.0)", TestSetup.getCause(e));
     return;
   }
   Assert.fail();
 }
Esempio n. 6
0
 @Test
 public void testMakeHashTableIntThreshold() {
   try {
     evaluateString("(make-hash-table :rehash-threshold 1)");
   } catch (Exception e) {
     Assert.assertEquals(
         "(error \"Invalid hash table rehash threshold\" 1)", TestSetup.getCause(e));
     return;
   }
   Assert.fail();
 }
Esempio n. 7
0
 @Test
 public void testMapHashWrongNumOfArgs() {
   try {
     evaluateString("(makehash :size 10.0)");
   } catch (Exception e) {
     Assert.assertEquals(
         "'(wrong-number-of-arguments (lambda (test) (make-hash-table :test (or test (quote eql)))) 2)",
         TestSetup.getCause(e));
     return;
   }
   Assert.fail();
 }