[svn:parrot] r38167 - branches/packfile_revamp/t/pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Thu Apr 16 22:36:13 UTC 2009


Author: bacek
Date: Thu Apr 16 22:36:12 2009
New Revision: 38167
URL: https://trac.parrot.org/parrot/changeset/38167

Log:
Reimplement t/pmc/packfilesegment.t in PIR

Modified:
   branches/packfile_revamp/t/pmc/packfilesegment.t

Modified: branches/packfile_revamp/t/pmc/packfilesegment.t
==============================================================================
--- branches/packfile_revamp/t/pmc/packfilesegment.t	Thu Apr 16 22:35:53 2009	(r38166)
+++ branches/packfile_revamp/t/pmc/packfilesegment.t	Thu Apr 16 22:36:12 2009	(r38167)
@@ -1,14 +1,7 @@
-#!perl
+#!parrot
 # Copyright (C) 2009, Parrot Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 1;
-use Parrot::Config;
-
 =head1 NAME
 
 t/pmc/packfilesegment.t - test the PackfileSegment PMC
@@ -24,46 +17,13 @@
 
 =cut
 
-
-# common setup code for later tests
-
-my $get_uuid_pbc = <<'EOF';
-
-.sub _pbc
-    .include "stat.pasm"
-    .include "interpinfo.pasm"
-    .local pmc pf, pio
-    pf   = new ['Packfile']
-    $S0  = interpinfo .INTERPINFO_RUNTIME_PREFIX
-    $S0 .= "/runtime/parrot/library/uuid.pbc"
-    $I0  = stat $S0, .STAT_FILESIZE
-    pio  = open $S0, 'r'
-    $S0  = read pio, $I0
-    close pio
-    pf   = $S0
-    .return(pf)
-.end
-EOF
-
-
-# PackfileSegment.pack (via subclass PackfileDirectory)
-
-pir_output_is( <<'CODE' . $get_uuid_pbc, <<'OUT', 'set_integer_keyed_str' );
 .sub 'test' :main
-    .local pmc pf, pfdir
-    pf    = _pbc()
-    pfdir = pf.'get_directory'()
-    $S0   = pfdir.'pack'()
-    $I0   = length $S0
-    eq $I0, 0, OUT1
-    print "not "
-    OUT1:
-    say "equal"
-.end
-CODE
-not equal
-OUT
+.include 'test_more.pir'
+    plan(1)
 
+    $P0 = new 'PackfileSegment'
+    isa_ok($P0, 'PackfileSegment')
+.end
 
 # Local Variables:
 #   mode: cperl


More information about the parrot-commits mailing list