# New Ticket Created by Steven Schubiger # Please include the string: [perl #34545] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=34545 >
> The test file t/pmc/pmc.t is full of Perl* tests. > These should be factored out into t/pmc/perl*.t. > The file itself should contain just common PMC functionality tests, > like the range or type checks. > Thanks, > leo
Index: t/pmc/random.t =================================================================== RCS file: /cvs/public/parrot/t/pmc/random.t,v retrieving revision 0.01 diff -u -r0.01 random.t --- /dev/null Tue Mar 22 21:05:08 2005 +++ t/pmc/random.t Tue Mar 22 20:29:59 2005 @@ -0,0 +1,75 @@ +#! perl -w + +# Copyright: 2001-2005 The Perl Foundation. All Rights Reserved. +# $Id: random.t,v 0.01 2005/03/22 18:00:00 leo Exp $ + +=head1 NAME + +t/pmc/random.t - Random basic type + +=head1 SYNOPSIS + + % perl -Ilib t/pmc/random.t + +=head1 DESCRIPTION + +Tests the Random PMC. + +=cut + +use Parrot::Test tests => 2; + +output_is(<<'CODE', <<'OUTPUT', "rand int"); + new P0, .Random + time I1 + set P0, I1 # seed + set I0, P0 + set I1, P0 + ne I0, I1, ok1 + print "not " +ok1:print "ok 1\n" + set I2, P0[100] + ne I0, I2, ok2 + print "not " +ok2:print "ok 2\n" + ge I2, 0, ok3 + print "not " +ok3:print "ok 3\n" + lt I2, 100, ok4 + print "not " +ok4:print "ok 4\n" + end +CODE +ok 1 +ok 2 +ok 3 +ok 4 +OUTPUT + +output_is(<<'CODE', <<'OUTPUT', "rand float"); + new P0, .Random + set N0, P0 + set N1, P0 + ne N0, N1, ok1 + print "not " +ok1:print "ok 1\n" + ge N0, 0, ok2 + print "not " +ok2:print "ok 2\n" + lt N0, 1.0, ok3 + print "not " +ok3:print "ok 3\n" + ge N1, 0, ok4 + print "not " +ok4:print "ok 4\n" + lt N1, 1.0, ok5 + print "not " +ok5:print "ok 5\n" + end +CODE +ok 1 +ok 2 +ok 3 +ok 4 +ok 5 +OUTPUT