[svn:parrot] r41133 - in trunk: . t/pmc

dukeleto at svn.parrot.org dukeleto at svn.parrot.org
Mon Sep 7 20:19:19 UTC 2009


Author: dukeleto
Date: Mon Sep  7 20:19:16 2009
New Revision: 41133
URL: https://trac.parrot.org/parrot/changeset/41133

Log:
[t] Finish translating t/pmc/integer.t to PIR and delete old file

Deleted:
   trunk/t/pmc/integer-old.t
Modified:
   trunk/MANIFEST
   trunk/t/pmc/integer.t

Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST	Mon Sep  7 20:02:06 2009	(r41132)
+++ trunk/MANIFEST	Mon Sep  7 20:19:16 2009	(r41133)
@@ -1877,7 +1877,6 @@
 t/pmc/hash.t                                                [test]
 t/pmc/hashiterator.t                                        [test]
 t/pmc/hashiteratorkey.t                                     [test]
-t/pmc/integer-old.t                                         [test]
 t/pmc/integer.t                                             [test]
 t/pmc/io.t                                                  [test]
 t/pmc/io_iterator.t                                         [test]

Deleted: trunk/t/pmc/integer-old.t
==============================================================================
--- trunk/t/pmc/integer-old.t	Mon Sep  7 20:19:16 2009	(r41132)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,54 +0,0 @@
-#!perl
-# Copyright (C) 2001-2009, Parrot Foundation.
-# $Id$
-
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-
-use Test::More;
-use Parrot::Test tests => 2;
-
-=head1 NAME
-
-t/pmc/integer-old.t - Perl tests for Integer basic type
-
-=head1 SYNOPSIS
-
-    % prove t/pmc/integer.t
-
-=head1 DESCRIPTION
-
-Perl tests the Integer PMC. These should be translated to PIR when possible.
-
-=cut
-
-
-pir_error_output_like( <<'CODE',qr/get_as_base: base out of bounds/ms, "get_as_base() bounds check" );
-.sub main :main
-    $P0 = new ['Integer']
-    $P0 = 42
-
-    $S0 = $P0.'get_as_base'(1)
-
-    say $S0
-.end
-CODE
-
-pir_error_output_like( <<'CODE', qr/get_as_base: base out of bounds/ms,"get_as_base() bounds check" );
-.sub main :main
-    $P0 = new ['Integer']
-    $P0 = 42
-
-    $S0 = $P0.'get_as_base'(37)
-
-    say $S0
-.end
-CODE
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:

Modified: trunk/t/pmc/integer.t
==============================================================================
--- trunk/t/pmc/integer.t	Mon Sep  7 20:02:06 2009	(r41132)
+++ trunk/t/pmc/integer.t	Mon Sep  7 20:19:16 2009	(r41133)
@@ -19,7 +19,7 @@
 .sub 'test' :main
     .include 'test_more.pir'
 
-    plan(58)
+    plan(60)
     test_basic_math()
     test_truthiness_and_definedness()
     test_set_string_native()
@@ -35,10 +35,29 @@
     test_get_as_base()
     test_get_as_base10()
     test_get_as_base_various()
+    test_get_as_base_bounds_check()
     test_cmp_subclass()
     test_cmp_RT59336()
 .end
 
+.sub test_get_as_base_bounds_check
+    throws_like(<<'CODE', ':s get_as_base\: base out of bounds', 'get_as_base lower bound check')
+    .sub main
+        $P0 = new ['Integer']
+        $P0 = 42
+        $S0 = $P0.'get_as_base'(1)
+        say $S0
+    .end
+CODE
+    throws_like(<<'CODE', ':s get_as_base\: base out of bounds', 'get_as_base upper bound check')
+    .sub main
+        $P0 = new ['Integer']
+        $P0 = 42
+        $S0 = $P0.'get_as_base'(37)
+        say $S0
+    .end
+CODE
+.end
 
 .sub test_basic_math
     .local pmc int_1


More information about the parrot-commits mailing list