Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[S32-num] add tests for Rat.perl
Specifically test to make sure .perl returns a decimal answer if the
denominator consists solely of the factors 2, 5, and/or -1.
  • Loading branch information
ShimmerFairy committed Mar 3, 2013
1 parent 234af25 commit f788145
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion S32-num/rat.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 821;
plan 824;

# Basic test functions specific to rational numbers.

Expand All @@ -23,6 +23,9 @@ isa_ok( eval(Rat.new(1, 3).perl), Rat, 'eval Rat.new(1, 3).perl is Rat' );
is( (eval Rat.new(1, 3).perl), 1/3, 'eval Rat.new(1, 3).perl is 1/3' );
isa_ok( eval((1/3).perl), Rat, 'eval (1/3).perl is Rat' );
is( (eval (1/3).perl), 1/3, 'eval (1/3).perl is 1/3' );
is( (1/10).perl, "0.1", '(1/10).perl is 0.1' );
is( (1/5).perl, "0.2", '(1/5).perl is .2' );
is( (1/2).perl, "0.5", '(1/2).perl is .5' );

# Test ~
#?pugs 4 skip 'Must only use named arguments to new() constructor'
Expand Down

0 comments on commit f788145

Please sign in to comment.