Author: coke
Date: Thu Mar 29 11:30:16 2007
New Revision: 17843

Modified:
   trunk/   (props changed)
   trunk/t/op/info.t
   trunk/t/op/random.t

Log:
convert two more tests to PIR from perl


Modified: trunk/t/op/info.t
==============================================================================
--- trunk/t/op/info.t   (original)
+++ trunk/t/op/info.t   Thu Mar 29 11:30:16 2007
@@ -1,13 +1,7 @@
-#!perl
+#! parrot
 # Copyright (C) 2001-2005, 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/op/info.t - Info Ops
@@ -22,15 +16,25 @@
 
 =cut
 
-pasm_output_is( <<'CODE', 'yes', "find_type" );
-       set I0, .ResizablePMCArray
-       find_type I1, "ResizablePMCArray"
-       eq I0, I1, YES
- NO:   print "no"
-       end
- YES:   print "yes"
-       end
-CODE
+.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)
+
+
+    set I0, .ResizablePMCArray
+    find_type I1, "ResizablePMCArray"
+    is (I0, I1, 'find_type matches dot syntax')
+.end
 
 # Local Variables:
 #   mode: cperl

Modified: trunk/t/op/random.t
==============================================================================
--- trunk/t/op/random.t (original)
+++ trunk/t/op/random.t Thu Mar 29 11:30:16 2007
@@ -1,13 +1,7 @@
-#!perl
+#!parrot
 # Copyright (C) 2001-2005, 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/op/random.t - Random numbers
@@ -22,14 +16,24 @@
 
 =cut
 
-pasm_output_is( <<'CODE', <<OUT, "generate random int" );
+.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)
+
     new P0, .Random
     set I0, P0
-    print "Called random just fine\n"
-    end
-CODE
-Called random just fine
-OUT
+    ok(1, 'Called random just fine')
+.end
 
 # Local Variables:
 #   mode: cperl

Reply via email to