[svn:parrot] r47101 - in trunk: . t/dynoplibs

plobsing at svn.parrot.org plobsing at svn.parrot.org
Sat May 29 06:13:52 UTC 2010


Author: plobsing
Date: Sat May 29 06:13:52 2010
New Revision: 47101
URL: https://trac.parrot.org/parrot/changeset/47101

Log:
add tests removed in r47100 to dynops testing

Added:
   trunk/t/dynoplibs/pmc_pow.t
Modified:
   trunk/MANIFEST

Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST	Sat May 29 06:12:50 2010	(r47100)
+++ trunk/MANIFEST	Sat May 29 06:13:52 2010	(r47101)
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Fri May 28 16:50:30 2010 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Sat May 29 06:13:08 2010 UT
 #
 # See below for documentation on the format of this file.
 #
@@ -1658,6 +1658,7 @@
 t/dynoplibs/io.t                                            [test]
 t/dynoplibs/math.t                                          [test]
 t/dynoplibs/obscure.t                                       [test]
+t/dynoplibs/pmc_pow.t                                       [test]
 t/dynoplibs/sysinfo.t                                       [test]
 t/dynoplibs/time.t                                          [test]
 t/dynoplibs/trans-infnan.t                                  [test]

Added: trunk/t/dynoplibs/pmc_pow.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/t/dynoplibs/pmc_pow.t	Sat May 29 06:13:52 2010	(r47101)
@@ -0,0 +1,78 @@
+#!./parrot
+# Copyright (C) 2010, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/dynoplibs/pmc_pow.t - Test C<pow> on PMCs
+
+=head1 SYNOPSIS
+
+    % prove t/dynoplibs/pmc_pew.t
+
+=head1 DESCRIPTION
+
+Test handling 3-arg C<pow> on PMCs.
+
+=cut
+
+.loadlib 'trans_ops'
+
+.sub main :main
+    .include 'test_more.pir'
+    .include 'iglobals.pasm'
+
+    plan (4)
+
+    # Don't check BigInt or BigNum without gmp
+    .local pmc interp     # a handle to our interpreter object.
+    interp = getinterp
+    .local pmc config
+    config = interp[.IGLOBALS_CONFIG_HASH]
+    .local string gmp
+    gmp = config['gmp']
+
+    test_pow('Integer')
+    test_pow('Float')
+
+    if gmp goto do_big_ones
+        skip( 22, "will not test BigInt or BigNum without gmp" )
+        goto end
+
+  do_big_ones:
+    test_pow('BigInt')
+    test_pow('BigNum')
+
+  end:
+.end
+
+.sub test_pow
+    .param pmc type
+
+    $P0 = new type
+    $P0 = 40
+    $P1 = new type
+    $P1 = 2
+    $P2 = new type
+    $P2 = 115200
+
+    $P99 = $P2
+
+    $S0 = "original dest is untouched in pow for "
+    $S1 = type
+    concat $S0, $S1
+
+    # ignore exceptions
+    push_eh done
+    pow $P2, $P0, $P1
+
+    $I0 = cmp $P99, 115200
+
+    is( $I0, 0, $S0 )
+    goto end
+
+  done:
+    ok(1, 'ignoring exceptions')
+  end:
+.end
+


More information about the parrot-commits mailing list