Skip to content

Commit

Permalink
Test .^roles on Rational classes doesn't hang
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Sep 26, 2017
1 parent 1f6a182 commit b5aff33
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion S32-num/rat.t
Expand Up @@ -3,7 +3,7 @@ use lib <t/spec/packages>;
use Test;
use Test::Util;

plan 844;
plan 845;

# Basic test functions specific to rational numbers.

Expand Down Expand Up @@ -433,4 +433,15 @@ subtest 'Rational.Int on zero-denominator rats' => {
is-deeply (4.99999999999999999999999999999999999999999999 ~~ 0..^5), True,
'literal with denominator > 64bit does not aquire f.p. noise';

# https://github.com/rakudo/rakudo/commit/0961abe8ff
subtest '.^roles on Rationals does not hang' => {
plan 3;
does-ok 42.2.^roles.grep(Rational).head, Rational, 'Rat:D';
does-ok FatRat.^roles.grep(Rational).head, Rational, 'FatRat:U';

my class Irrational does Rational[UInt, Int] {};
does-ok Irrational.new.^roles.grep(Rational).head, Rational[UInt, Int],
'custom class :D';
}

# vim: ft=perl6

0 comments on commit b5aff33

Please sign in to comment.