Permalink
Browse files

[t/spec] Test Num.perl. Who'd have thought that 1.0.perl wouldn't wor…

…k in Rakudo?

git-svn-id: http://svn.pugscode.org/pugs@28818 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent 86b6962 commit f646c2d63d33ad6504509ce52e632ea4a2c3b073 colomon committed Oct 18, 2009
Showing with 16 additions and 1 deletion.
  1. +16 −1 S02-builtin_data_types/num.t
@@ -4,7 +4,22 @@ use Test;
#L<S02/Built-In Data Types/Perl intrinsically supports big integers>
-plan 48;
+plan 58;
+
+#?rakudo todo "Num.perl doesn't report the decimal part if it is 0"
+isa_ok( eval(1.Num.perl), Num, 'eval 1.Num.perl is Num' );
+is_approx( eval(1.Num.perl), 1, 'eval 1.Num.perl is 1' );
+#?rakudo todo "Num.perl doesn't report the decimal part if it is 0"
+isa_ok( eval(0.Num.perl), Num, 'eval 0.Num.perl is Num' );
+is_approx( eval(0.Num.perl), 0, 'eval 0.Num.perl is 0' );
+#?rakudo todo "Num.perl doesn't report the decimal part if it is 0"
+isa_ok( eval((-1).Num.perl), Num, 'eval -1.Num.perl is Num' );
+is_approx( eval((-1).Num.perl), -1, 'eval -1.Num.perl is -1' );
+isa_ok( eval(1.1.perl), Num, 'eval 1.1.Num.perl is Num' );
+is_approx( eval(1.1.perl), 1.1, 'eval 1.1.Num.perl is 1.1' );
+isa_ok( eval((-1.1).perl), Num, 'eval -1.1.Num.perl is Num' );
+is_approx( eval((-1.1).perl), -1.1, 'eval -1.1.Num.perl is -1.1' );
+
{
my $a = 1; "$a";
isa_ok($a, Int);

0 comments on commit f646c2d

Please sign in to comment.