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))))
def test_integers_dot_nil(self): self.assertEqual( visp.read("(1 2 3 . ())"), visp.cons(1, visp.cons(2, visp.cons(3, visp.nil))))
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))))
def test_nested(self): self.assertEqual( visp.read("((1 . 2) . (3 . 4))"), visp.cons(visp.cons(1, 2), visp.cons(3, 4)))
def test_cdr(self): self.assertEqual(visp.cons(1, 2).cdr, 2)
def test_car(self): self.assertEqual(visp.cons(1, 2).car, 1)
def test_integers_dot_nil(self): self.assertEqual(visp.read("(1 2 3 . ())"), visp.cons(1, visp.cons(2, visp.cons(3, visp.nil))))
def test_nested(self): self.assertEqual(visp.read("((1 . 2) . (3 . 4))"), visp.cons(visp.cons(1, 2), visp.cons(3, 4)))