Author: coke
Date: Tue Apr 24 19:37:03 2007
New Revision: 18330

Modified:
   trunk/   (props changed)
   trunk/t/pmc/object.t

Log:
[t] convert a test to parrot from perl



Modified: trunk/t/pmc/object.t
==============================================================================
--- trunk/t/pmc/object.t        (original)
+++ trunk/t/pmc/object.t        Tue Apr 24 19:37:03 2007
@@ -1,13 +1,7 @@
-#!perl
+#! parrot
 # Copyright (C) 2007, The Perl Foundation.
 # $Id$
 
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 1;
-
 =head1 NAME
 
 t/pmc/object.t - test the Object PMC
@@ -24,20 +18,31 @@
 
 # L<PDD15/Object PMC API>
 # TODO fix smartlinks once this is specced
-pir_output_is( <<'CODE', <<'OUT', 'new' );
-.sub 'test' :main
-    push_eh ok_1
-    $P0 = new 'Object'
+## TODO add more tests as this is documented and implemented
+
+.sub main :main
+    # load this library
+    load_bytecode 'library/Test/More.pir'
+
+    # get the testing functions
+    .local pmc exports, curr_namespace, test_namespace
+    curr_namespace = get_namespace
+    test_namespace = get_namespace [ "Test::More" ]
+    exports = split " ", "plan diag ok is is_deeply like isa_ok"
+
+    test_namespace."export_to"(curr_namespace, exports)
+
+    plan(1)
+
+    push_eh cant_instantiate
+      new P0, .Object
     clear_eh
-    print "not "
-ok_1:
-    say "ok 1 - $P0 = new 'Object' throws exception"
+    ok(0, 'Able to instantiate .Object')
+    goto done_1
+cant_instantiate:
+    ok(1, 'Unable to Instantiate .Object')
+done_1:
 .end
-CODE
-ok 1 - $P0 = new 'Object' throws exception
-OUT
-
-## TODO add more tests as this is documented and implemented
 
 # Local Variables:
 #   mode: cperl

Reply via email to