# Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 7; use Python::Bytecode; ok(1); # If we made it this far, we're ok. ######################### # Insert your test code below, the Test module is use()ed here so read # its man page ( perldoc Test ) for help writing this test script. open IN, "test2.pyc" or die $!; binmode IN; my $code = Python::Bytecode->new(\*IN); ok(defined $code); is($code->filename, "test2.py"); is((join "\n", map { $_->[0] } $code->disassemble, (),""), <> 33 POP_TOP >> 34 LOAD_CONST 1 () 37 RETURN_VALUE EOF ); close IN; open IN, "test23.pyc" or die $!; binmode IN; my $code = Python::Bytecode->new(\*IN); ok(defined $code); is($code->filename, "./test23.py"); is((join "\n", map { $_->[0] } $code->disassemble, (),""), <> 21 POP_TOP >> 22 LOAD_CONST 1 () 25 RETURN_VALUE EOF );