Exemplo n.º 1
0
    def test_object(self):
        vm = perl5.VM()

        ret = vm.eval(SCRIPT)
        self.assertEqual(ret, 1)

        o = vm.package("Px::Testing").new()
        self.assertIsInstance(o, Proxy)

        o2 = vm.package("Px::Testing").new()
        self.assertNotEqual(o, o2)

        method = o.method
        self.assertIsInstance(method, CodeRefProxy)

        self.assertEqual(method, o.method)

        ret = method(1)
        self.assertEqual(ret, 1)
Exemplo n.º 2
0
 def setUp(self):
     self.vm = vm = perl5.VM()
     vm.eval(SCRIPT)
Exemplo n.º 3
0
    def test_type(self):
        vm = perl5.VM()

        self.assertIsInstance(vm, VM)
        self.assertIsInstance(vm.type_mapper, TypeMapper)