Exemplo n.º 1
0
 def test_unique(self):
     s1 = pyscm.make_symbol('foo')
     s2 = pyscm.make_symbol('foo')
     s3 = pyscm.make_symbol('bar')
     self.assertTrue(s1 is s2)
     self.assertFalse(s1 is s3)
     self.assertFalse(s2 is s3)
Exemplo n.º 2
0
    def test_equal(self):
        t = pyscm.make_boolean(True)
        f = pyscm.make_boolean(False)
        self.assertTrue(t is pyscm.eq([2, 2]))
        self.assertTrue(t is pyscm.eq_question_mark([2, 2]))
        self.assertTrue(f is pyscm.eq_question_mark([2, 2.0]))
        self.assertTrue(t is pyscm.eq([2, 2.0]))
        self.assertTrue(t is pyscm.eq_question_mark([t,\
            pyscm.make_boolean(True)]))
        self.assertTrue(t is pyscm.eq_question_mark([
                pyscm.make_symbol('foo'),
                pyscm.make_symbol('foo')
            ]))

        self.assertTrue(t is pyscm.eq_question_mark([
                pyscm.evaluate(['quote', []], {}),
                pyscm.evaluate(['quote', []], {})
            ]))