Example #1
0
 def test_list_of_pairs(self):
     self.assertEqual(
         visp.read("((1 . 2) (3 . 4) (5 . 6))"),
         visp.cons(
             visp.cons(1, 2),
             visp.cons(visp.cons(3, 4), visp.cons(visp.cons(5, 6),
                                                  visp.nil))))
Example #2
0
 def test_integers_dot_nil(self):
     self.assertEqual(
         visp.read("(1 2 3 . ())"),
         visp.cons(1, visp.cons(2, visp.cons(3, visp.nil))))
Example #3
0
 def test_list_of_pairs(self):
     self.assertEqual(
         visp.read("((1 . 2) (3 . 4) (5 . 6))"),
         visp.cons(visp.cons(1, 2), 
             visp.cons(visp.cons(3, 4),
                 visp.cons(visp.cons(5, 6), visp.nil))))
Example #4
0
 def test_nested(self):
     self.assertEqual(
         visp.read("((1 . 2) . (3 . 4))"),
         visp.cons(visp.cons(1, 2), visp.cons(3, 4)))
Example #5
0
 def test_cdr(self):
     self.assertEqual(visp.cons(1, 2).cdr, 2)
Example #6
0
 def test_car(self):
     self.assertEqual(visp.cons(1, 2).car, 1)
Example #7
0
 def test_integers_dot_nil(self):
     self.assertEqual(visp.read("(1 2 3 . ())"),
                      visp.cons(1, visp.cons(2, visp.cons(3, visp.nil))))
Example #8
0
 def test_nested(self):
     self.assertEqual(visp.read("((1 . 2) . (3 . 4))"),
                      visp.cons(visp.cons(1, 2), visp.cons(3, 4)))