[pirate] More tests passing on pirate

Tyler Coumbes coumbes at gmail.com
Sun Jun 4 07:14:59 EDT 2006


Now that finals are over :-) I have done a little more work on pirate
and the python PMCs. At the bottom is the output of PirateTest.py with
my changes. Some features I have disabled in the python PMCs for now
while getting them updated to work with Parrot 0.4.4 This is the
output running Pirate with Python 2.4 and Parrot 0.4.4 on my
Powerbook. None of my changes so far are in the parrot svn and any
changes to pirate.py may or may not be what you all would of done, but
most of those so far have just been to the generated PIR. Also for now
lexicals are not properly handled more on that later.

...F..FF....FFF......F...FF..F.....FFF.......FF............F..
======================================================================
FAIL: test_augmented_assignment
----------------------------------------------------------------------
Traceback (most recent call last):
  File "PirateTest.py", line 179, in <lambda>
    testFunc = lambda self, test=test: self.runTest(test)
  File "PirateTest.py", line 41, in runTest
    self.assertEquals(res, open(outfile).read().strip())
AssertionError: '' != '1 [2, 3, 4] 5'

======================================================================
FAIL: test_class
----------------------------------------------------------------------
Traceback (most recent call last):
  File "PirateTest.py", line 179, in <lambda>
    testFunc = lambda self, test=test: self.runTest(test)
  File "PirateTest.py", line 41, in runTest
    self.assertEquals(res, open(outfile).read().strip())
AssertionError: "Class Stuff already registered!\ncurrent instr.:
'__main__' pc 14 (-:17)" != 'Stuff'

======================================================================
FAIL: test_clear_eh (__main__.PirateTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "PirateTest.py", line 162, in test_clear_eh
    self.assertEquals(res, "Lexical 'hell' not found\n")
AssertionError: "Global 'hell' not found\ncurrent instr.: '__main__'
pc 12 (-:23)\n" != "Lexical 'hell' not found\n"

======================================================================
FAIL: test_del_attr (__main__.PirateTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "PirateTest.py", line 78, in test_del_attr
    self.assertEquals(res, "1\nAttributeError: C instance has no
attribute 'x'\n")
AssertionError: '' != "1\nAttributeError: C instance has no attribute 'x'\n"

======================================================================
FAIL: test_del_key (__main__.PirateTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "PirateTest.py", line 88, in test_del_key
    self.assertEquals(res, "b\nKeyError: 'a'\n")
AssertionError: "b\nKeyError: 'a'\ncurrent instr.: '__main__' pc 44
(-:29)\n" != "b\nKeyError: 'a'\n"

======================================================================
FAIL: test_del_name (__main__.PirateTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "PirateTest.py", line 67, in test_del_name
    self.assertEquals(res, "Lexical 'x' not found\n")
AssertionError: "Null PMC access in delete_keyed()\ncurrent instr.:
'__main__' pc 9 (-:15)\n" != "Lexical 'x' not found\n"

======================================================================
FAIL: test_generator
----------------------------------------------------------------------
Traceback (most recent call last):
  File "PirateTest.py", line 179, in <lambda>
    testFunc = lambda self, test=test: self.runTest(test)
  File "PirateTest.py", line 41, in runTest
    self.assertEquals(res, open(outfile).read().strip())
AssertionError: "error:imcc:syntax error, unexpected PREG, expecting
'('\nin file '-' line 42" != '0 1 done'

======================================================================
FAIL: test_instance
----------------------------------------------------------------------
Traceback (most recent call last):
  File "PirateTest.py", line 179, in <lambda>
    testFunc = lambda self, test=test: self.runTest(test)
  File "PirateTest.py", line 41, in runTest
    self.assertEquals(res, open(outfile).read().strip())
AssertionError: "Can't find method '__invoke' - erroneous PMC\ncurrent
instr.: '__main__' pc 28 (-:20)" != '1 2 0 0 Thing'

======================================================================
FAIL: test_int
----------------------------------------------------------------------
Traceback (most recent call last):
  File "PirateTest.py", line 179, in <lambda>
    testFunc = lambda self, test=test: self.runTest(test)
  File "PirateTest.py", line 41, in runTest
    self.assertEquals(res, open(outfile).read().strip())
AssertionError: '' != '__abs__ 31 31\n__add__ 18 18\n__and__ 19
19\n__cmp__ 1 1\n__div__ -3 -3\n__float__ 31.0 31.0\n__floordiv__ -3
-3\n__hex__ 0x1f 0x1f\n__int__ 31 31\n__invert__ -32 -32\n__lshift__
248 248\n__mod__ -8 -8\n__mul__ -403 -403\n__neg__ -31
-31\n__nonzero__ True\n__oct__ 037 037\n__or__ -1 -1\n__pos__ 31
31\n__pow__ 961 961\n__radd__ 18 18\n__rand__ 19 19\n__rdiv__ -1
-1\n__repr__ 31\n__rfloordiv__ -1 -1\n__rlshift__ 124 124\n__rmod__ 18
18\n__rmul__ -403 -403\n__ror__ -1 -1\n__rpow__ 961 961\n__rrshift__ 7
7\n__rshift__ 7 7\n__rsub__ -44 -44\n__rxor__ -20 -20\n__str__ 31
31\n__sub__ 44 44\n__truediv__ -2.38461538462\n__xor__ -20 -20'

======================================================================
FAIL: test_lexical_scope
----------------------------------------------------------------------
Traceback (most recent call last):
  File "PirateTest.py", line 179, in <lambda>
    testFunc = lambda self, test=test: self.runTest(test)
  File "PirateTest.py", line 41, in runTest
    self.assertEquals(res, open(outfile).read().strip())
AssertionError: '15 5' != '15 1'

======================================================================
FAIL: test_methods
----------------------------------------------------------------------
Traceback (most recent call last):
  File "PirateTest.py", line 179, in <lambda>
    testFunc = lambda self, test=test: self.runTest(test)
  File "PirateTest.py", line 41, in runTest
    self.assertEquals(res, open(outfile).read().strip())
AssertionError: "Can't find method '__invoke' - erroneous PMC\ncurrent
instr.: '__main__' pc 28 (-:21)" != 'hello!'

======================================================================
FAIL: test_microthreads
----------------------------------------------------------------------
Traceback (most recent call last):
  File "PirateTest.py", line 179, in <lambda>
    testFunc = lambda self, test=test: self.runTest(test)
  File "PirateTest.py", line 41, in runTest
    self.assertEquals(res, open(outfile).read().strip())
AssertionError: "error:imcc:syntax error, unexpected PREG, expecting
'('\nin file '-' line 64" != 'a b a b a b a b'

======================================================================
FAIL: test_microthreads_more
----------------------------------------------------------------------
Traceback (most recent call last):
  File "PirateTest.py", line 179, in <lambda>
    testFunc = lambda self, test=test: self.runTest(test)
  File "PirateTest.py", line 41, in runTest
    self.assertEquals(res, open(outfile).read().strip())
AssertionError: "error:imcc:syntax error, unexpected PREG, expecting
'('\nin file '-' line 39" != '0 1 2'

======================================================================
FAIL: test_raise (__main__.PirateTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "PirateTest.py", line 131, in test_raise
    self.assertEquals(res, "to be or not to be\n")
AssertionError: "to be ornot to be\ncurrent instr.: '__main__' pc 9
(-:16)\n" != 'to be or not to be\n'

======================================================================
FAIL: test_range
----------------------------------------------------------------------
Traceback (most recent call last):
  File "PirateTest.py", line 179, in <lambda>
    testFunc = lambda self, test=test: self.runTest(test)
  File "PirateTest.py", line 41, in runTest
    self.assertEquals(res, open(outfile).read().strip())
AssertionError: "Global 'range' not found\ncurrent instr.: '__main__'
pc 18 (-:18)" != '[]\n[0, 1, 2, 3, 4]\n[0, 1, 2, 3, 4, 5, 6, 7, 8,
9]\n[0, 2, 4, 6, 8]'

======================================================================
FAIL: test_varargs
----------------------------------------------------------------------
Traceback (most recent call last):
  File "PirateTest.py", line 179, in <lambda>
    testFunc = lambda self, test=test: self.runTest(test)
  File "PirateTest.py", line 41, in runTest
    self.assertEquals(res, open(outfile).read().strip())
AssertionError: "(1, 2, 3)\n(3, 1, 2)\nMethod '__call__' not
found\ncurrent instr.: '__main__' pc 167 (-:73)" != '(1, 2, 3)\n(3, 1,
2)\n(1, 2, 3)\n(1, 2, 3)\n(1, 2, 3)\n(3, 1, 2)\n(1, 2, 3)\n(1, 2, 3)'

----------------------------------------------------------------------
Ran 62 tests in 12.658s

FAILED (failures=16)


More information about the pirate mailing list