From 6e0e9d5c00c0fc21417ce8399531f5a5cb7b73bd Mon Sep 17 00:00:00 2001 From: toyam Date: Wed, 22 Jul 2009 23:37:55 +0000 Subject: [PATCH] Stop some tests in S02 assuming that a floating point literal like 1.2 is of type Rat. git-svn-id: http://svn.pugscode.org/pugs@27674 c213334d-75ef-0310-aa23-eaa082d1ae64 --- S02-builtin_data_types/num.t | 3 +-- S02-builtin_data_types/type.t | 4 ++-- TODO | 5 ----- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/S02-builtin_data_types/num.t b/S02-builtin_data_types/num.t index e770d152d2..3b5278ac74 100644 --- a/S02-builtin_data_types/num.t +++ b/S02-builtin_data_types/num.t @@ -103,8 +103,7 @@ isa_ok(1 div 1, Rat); { my $a = 1.0000000000000000000000000000000000000000000000000000000000000000000e1; - #?rakudo skip "no Rat yet" - isa_ok($a, Rat); + isa_ok($a, Num); ok($a == 10.0, 'trailing zeros compare correctly'); } diff --git a/S02-builtin_data_types/type.t b/S02-builtin_data_types/type.t index 8c3f9d4951..45b26021c2 100644 --- a/S02-builtin_data_types/type.t +++ b/S02-builtin_data_types/type.t @@ -118,8 +118,8 @@ my $baz of Int; { # the following two are the same type of behavior # S02: "It is possible for the of type to disagree with the as type" - my Rat sub returntype4 ($pass) as Num {$pass ?? 1.1 !! 1} - my sub returntype5 ($pass --> Rat) as Num {$pass ?? 2.2 !! 2} + my Rat sub returntype4 ($pass) as Num {$pass ?? 11 div 10 !! 1} + my sub returntype5 ($pass --> Rat) as Num {$pass ?? 11 div 5 !! 2} is(returntype4(True), 1.1, 'good return value works (my Type sub as OtherType)'); eval_dies_ok('returntype4(False)', 'bad return value dies (my Type sub as OtherType)'); diff --git a/TODO b/TODO index e97025b9ab..e657099b79 100644 --- a/TODO +++ b/TODO @@ -45,11 +45,6 @@ the spec (newest first) S02 * tests for Implementation types (the Perl 6 equiv. of tie()), probably need more specs as well -* some tests in S02 assume that a floating point literal like 1.2 is of typ - Rat (rational), but it really is of type Num. Same for things like (1 / 2) - (to produce a Rat you need (1 div 2) or (1/2) without spaces). - This needs cleanup. Just grep for Rat, - review the tests and clean them up where appropriate S03 * tests for cmp() and eqv() methods of objects