Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix a bunch of typeobject stringifications.

  • Loading branch information...
commit f85b8bf91f4cf33d737ee8a0fedd91dbdf44c15b 1 parent 68595f2
kboga authored
Showing with 73 additions and 73 deletions.
  1. +2 −2 S02-builtin_data_types/hash.t
  2. +1 −1  S02-builtin_data_types/range.t
  3. +1 −1  S02-names_and_variables/list_array_perl.t
  4. +3 −3 S02-names_and_variables/perl.t
  5. +3 −3 S03-junctions/misc.t
  6. +1 −1  S03-operators/basic-types.t
  7. +1 −1  S03-operators/context.t
  8. +4 −4 S03-operators/inplace.t
  9. +4 −4 S03-operators/range.t
  10. +2 −2 S04-exception-handlers/catch.t
  11. +4 −4 S05-capture/array-alias.t
  12. +1 −1  S05-grammar/inheritance.t
  13. +1 −1  S06-advanced_subroutine_features/caller.t
  14. +1 −1  S06-multi/type-based.t
  15. +3 −3 S06-other/anon-hashes-vs-blocks.t
  16. +1 −1  S12-class/anonymous.t
  17. +1 −1  S12-class/instantiate.t
  18. +1 −1  S12-enums/basic.t
  19. +2 −2 S12-introspection/methods.t
  20. +11 −11 S12-methods/what.t
  21. +1 −1  S14-roles/instantiation.t
  22. +1 −1  S14-roles/namespaced.t
  23. +1 −1  S32-array/create.t
  24. +2 −2 S32-hash/delete.t
  25. +7 −7 S32-hash/kv.t
  26. +1 −1  S32-hash/push.t
  27. +2 −2 S32-list/create.t
  28. +1 −1  S32-num/rat.t
  29. +3 −3 S32-str/substr.t
  30. +1 −1  integration/advent2009-day01.t
  31. +4 −4 integration/advent2009-day14.t
  32. +1 −1  integration/advent2009-day18.t
View
4 S02-builtin_data_types/hash.t
@@ -153,11 +153,11 @@ is(%hash10<1>, 2, "assignment of pointy qw to hash");
sub test1 {
my %sane = hash ('a'=>'b');
- is(~%sane.WHAT,Hash,'%sane is a Hash');
+ is(%sane.WHAT.gist,Hash.gist,'%sane is a Hash');
}
sub test2 (%hash) {
- is(~%hash.WHAT,Hash,'%hash is a Hash');
+ is(%hash.WHAT.gist,Hash.gist,'%hash is a Hash');
}
my %h = hash (a => 'b');
View
2  S02-builtin_data_types/range.t
@@ -9,7 +9,7 @@ plan 124;
my $r = 1..5;
isa_ok $r, Range, 'Type';
-is $r.WHAT, Range, 'Type';
+is $r.WHAT.gist, Range.gist, 'Type';
is $r.perl, '1..5', 'canonical representation';
# XXX unspecced: exact value of Range.perl
View
2  S02-names_and_variables/list_array_perl.t
@@ -35,7 +35,7 @@ my @tests = (
my $s = (~$obj).subst(/\n/, '');
ok eval($obj.perl) eq $obj,
"($s.perl()).perl returned something whose eval()ed stringification is unchanged";
- is ~(eval($obj.perl).WHAT), ~$obj.WHAT,
+ is (eval($obj.perl).WHAT).gist, $obj.WHAT.gist,
"($s.perl()).perl returned something whose eval()ed .WHAT is unchanged";
}
}
View
6 S02-names_and_variables/perl.t
@@ -64,7 +64,7 @@ my @tests = (
my $s = (~$obj).subst(/\n/, '');
ok eval($obj.perl) eq $obj,
"($s.perl()).perl returned something whose eval()ed stringification is unchanged";
- is ~WHAT(eval($obj.perl)), ~$obj.WHAT,
+ is WHAT(eval($obj.perl)).gist, $obj.WHAT.gist,
"($s.perl()).perl returned something whose eval()ed .WHAT is unchanged";
}
}
@@ -143,8 +143,8 @@ my @tests = (
# RT #69869
{
- is 1.0.WHAT, Rat, '1.0 is Rat';
- is eval( 1.0.perl ).WHAT, Rat, "1.0 perl'd and eval'd is Rat";
+ is 1.0.WHAT.gist, Rat.gist, '1.0 is Rat';
+ is eval( 1.0.perl ).WHAT.gist, Rat.gist, "1.0 perl'd and eval'd is Rat";
}
View
6 S03-junctions/misc.t
@@ -12,7 +12,7 @@ Misc. Junction tests
#?rakudo 2 skip 'Null PMC access in get_integer() (RT #64184)'
isa_ok any(6,7), Junction;
-is any(6,7).WHAT, Junction, 'junction.WHAT works';
+is any(6,7).WHAT.gist, Junction.gist, 'junction.WHAT works';
# avoid auto-threading on ok()
sub jok(Mu $condition, $msg?) { ok ?($condition), $msg };
@@ -135,10 +135,10 @@ sub jok(Mu $condition, $msg?) { ok ?($condition), $msg };
$j = 1|2;
#?rakudo 2 todo 'lower case junction type'
- is(~WHAT($j), 'Junction()', 'basic junction type reference test');
+ is(WHAT($j).gist, 'Junction()', 'basic junction type reference test');
$k=$j;
- is(~WHAT($k), 'Junction()', 'assignment preserves reference');
+ is(WHAT($k).gist, 'Junction()', 'assignment preserves reference');
}
View
2  S03-operators/basic-types.t
@@ -7,7 +7,7 @@ plan 19;
# WHAT() on basic types
my $a;
-is($a.WHAT, Any, 'empty scalar is Any');
+is($a.WHAT.gist, Any.gist, 'empty scalar is Any');
my @a;
ok(@a ~~ Array, 'it is an Array type');
View
2  S03-operators/context.t
@@ -38,7 +38,7 @@ use Test;
my $a = 3;
my $b = 2;
- is(~(item $a).WHAT, ~$a.WHAT, '(item $a).WHAT matches $a.WHAT');
+ is((item $a).WHAT.gist, $a.WHAT.gist, '(item $a).WHAT matches $a.WHAT');
is((item $a), $a, 'item $a is just $a');
is(item($a), $a, 'item($a) is just $a');
is($($a), $a, '$($a) is just $a');
View
8 S03-operators/inplace.t
@@ -32,10 +32,10 @@ plan 28;
my $c = 42; $c .= WHAT;
my $d = 42.23; $d .= WHAT;
my @e = <a b c d>; @e .= WHAT;
- is($b, Str, "inplace WHAT of a Str");
- is($c, Int, "inplace WHAT of a Num");
- is($d, Rat, "inplace WHAT of a Rat");
- is(@e[0], Array, "inplace WHAT of an Array");
+ isa_ok($b, Str, "inplace WHAT of a Str");
+ isa_ok($c, Int, "inplace WHAT of a Num");
+ isa_ok($d, Rat, "inplace WHAT of a Rat");
+ isa_ok(@e[0], Array, "inplace WHAT of an Array");
}
my $f = "lowercase"; $f .= uc;
View
8 S03-operators/range.t
@@ -156,9 +156,9 @@ is (1..6 Z 'a' .. 'c').join, '1a2b3c', 'Ranges and infix:<Z>';
lives_ok { $range = $start..$end },
'can make range from numeric string vars';
is $range.min, $start, 'range starts at start';
- is $range.min.WHAT, "Str()", 'range start is a string';
+ is $range.min.WHAT.gist, "Str()", 'range start is a string';
is $range.max, $end, 'range ends at end';
- is $range.max.WHAT, "Str()", 'range end is a string';
+ is $range.max.WHAT.gist, "Str()", 'range end is a string';
lives_ok { "$range" }, 'can stringify range';
is ~$range, "100.B 101.B 102.B", 'range is correct';
}
@@ -196,9 +196,9 @@ is (1..6 Z 'a' .. 'c').join, '1a2b3c', 'Ranges and infix:<Z>';
lives_ok { '1 3' ~~ /(\d+) \s (\d+)/; $range = ~$0..~$1 },
'can make range from match vars with string context forced';
is $range.min, 1, 'range starts at one';
- is $range.min.WHAT, "Str()", 'range start is a string';
+ is $range.min.WHAT.gist, "Str()", 'range start is a string';
is $range.max, 3, 'range ends at three';
- is $range.max.WHAT, "Str()", 'range end is a string';
+ is $range.max.WHAT.gist, "Str()", 'range end is a string';
lives_ok { "$range" }, 'can stringify range';
is ~$range, "1 2 3", 'range is correct';
}
View
4 S04-exception-handlers/catch.t
@@ -119,10 +119,10 @@ lives_ok { do {die 'blah'; CATCH {default {}}}; }, 'do block with CATCH {default
#?rakudo todo 'CATCH'
ok(!$lived, "did not live past uncaught throw");
ok(!$naughty, "did not get caught by wrong handler");
- ok(~WHAT($!), '$! is an object');
+ ok(WHAT($!).gist, '$! is an object');
#?pugs skip 'bug'
#?rakudo todo 'Exception types'
- is(WHAT($!), Dandy, ".. of the right class");
+ is(WHAT($!).gist, Dandy.gist, ".. of the right class");
};
#?rakudo skip 'llops'
View
8 S05-capture/array-alias.t
@@ -68,11 +68,11 @@ is(join("|", @<spaces>), " | |\t", 'Subrule array capture');
ok(" a b\tc" ~~ m/@<chars>=[ (<?spaces>) (\S+)]+/, 'Nested multiple array capture');
-is(WHAT $<chars>, "Array", 'Multiple capture to nested array');
+is(WHAT($<chars>).gist, "Array()", 'Multiple capture to nested array');
ok(@<chars> == 3, 'Multiple capture count');
-is(~WHAT $<chars>[0], "Match", 'Multiple capture to nested AoA[0]');
-is(~WHAT $<chars>[1], "Match", 'Multiple capture to nested AoA[2]');
-is(~WHAT $<chars>[2], "Match", 'Multiple capture to nested AoA[3]');
+is(WHAT($<chars>[0]).gist, "Match()", 'Multiple capture to nested AoA[0]');
+is(WHAT($<chars>[1]).gist, "Match()", 'Multiple capture to nested AoA[2]');
+is(WHAT($<chars>[2]).gist, "Match()", 'Multiple capture to nested AoA[3]');
is(~$<chars>[0][0], " ", 'Multiple capture value of nested AoA[0][0]');
is(~$<chars>[0][1], "a", 'Multiple capture value of nested AoA[0][1]');
is(~$<chars>[1][0], " ", 'Multiple capture value of nested AoA[1][0]');
View
2  S05-grammar/inheritance.t
@@ -58,7 +58,7 @@ is(~('baz' ~~ /^<Grammar::Baz::any>$/), 'baz', 'got right match');
}
-is(Grammar.WHAT,"Grammar()", "Grammar.WHAT = Grammar()");
+is(Grammar.WHAT.gist,"Grammar()", "Grammar.WHAT.gist = Grammar()");
done;
View
2  S06-advanced_subroutine_features/caller.t
@@ -45,7 +45,7 @@ sub chain { B.try_it_caller_B(@_) }
# basic tests of caller object
#?niecza skip "NYI"
{
- chain({ WHAT caller() }, "Control::Caller", "caller object type");
+ chain({ WHAT(caller()).gist }, "Control::Caller()", "caller object type");
chain({ caller().package }, "Main", "caller package");
chain({ caller().file }, $?FILE, "caller filename");
chain({ caller().line }, "32", "caller line");
View
2  S06-multi/type-based.t
@@ -87,7 +87,7 @@ is(mmd(1..3), 2, 'Slurpy MMD to listop via list');
is wins(Paper.new, Scissor.new), -1, 'fallback if there is a ::T variant';
multi wins2(Scissor $x, Paper $y) { 1 } #OK not used
- multi wins2($x, $y where { $x.WHAT eq $y.WHAT }) { 0 }
+ multi wins2($x, $y where { $x.WHAT.gist eq $y.WHAT.gist }) { 0 }
multi wins2($x, $y) { -1 } #OK not used
is wins2(Scissor.new, Paper.new), 1, 'Basic sanity 2';
is wins2(Paper.new, Paper.new), 0, 'multi dispatch with faked generics';
View
6 S06-other/anon-hashes-vs-blocks.t
@@ -33,9 +33,9 @@ ok $bar ~~ Hash, '%foo in a block causes hash composing';
%hash<bar> //= hash;
my $h_ref;
$h_ref //= hash();
- is(%hash<foo>.WHAT, ::Hash, "Parses as two items");
- is(%hash<bar>.WHAT, ::Hash, "Parens do not help");
- is($h_ref.WHAT, ::Hash, "It is not limited to hash values");
+ is(%hash<foo>.WHAT.gist, ::Hash.gist, "Parses as two items");
+ is(%hash<bar>.WHAT.gist, ::Hash.gist, "Parens do not help");
+ is($h_ref.WHAT.gist, ::Hash.gist, "It is not limited to hash values");
}
{
View
2  S12-class/anonymous.t
@@ -12,7 +12,7 @@ my $t1 = $c1.new();
ok(defined($t1), 'instantiated the class');
ok($t1 ~~ $c1, 'isa check works');
#?rakudo todo 'Anonymous class stringification (?)'
-is(~$c1.WHAT(), '()', '.WHAT stringifies to ()');
+is($c1.WHAT().gist, '()', '.WHAT.gist stringifies to ()');
# Anonymous classes with methods.
my $c2 = class { method foo { 42 }; method bar { 28 } };
View
2  S12-class/instantiate.t
@@ -43,7 +43,7 @@ is($foo2.check(), 42, 'initializing attributes in new');
class Foo { };
my $x = 'Foo';
my $y = $x.new;
- is($y.WHAT, Str, "instantiating from class name string creates a Str object");
+ is($y.WHAT.gist, Str.gist, "instantiating from class name string creates a Str object");
}
# vim: ft=perl6
View
2  S12-enums/basic.t
@@ -51,7 +51,7 @@ enum Day <Sun Mon Tue Wed Thu Fri Sat>;
is Mon.key, 'Mon', '.key on short form of Enum value';
#?rakudo todo 'enum + .WHAT'
- is Day::Mon.WHAT, 'Day()', '.WHAT on enum value stringifies to the enum name';
+ is Day::Mon.WHAT.gist, 'Day()', '.WHAT.gist on enum value stringifies to the enum name';
}
{
View
4 S12-introspection/methods.t
@@ -82,9 +82,9 @@ is +@methods, 4, ':tree gives us right number of elements';
ok @methods[0].name eq 'foo' && @methods[1].name eq 'bar' ||
@methods[0].name eq 'bar' && @methods[1].name eq 'foo',
'first two methods from class D itself';
-is @methods[2].WHAT, Array, 'third item is an array';
+is @methods[2].WHAT.gist, Array.gist, 'third item is an array';
is +@methods[2], 2, 'nested array for B had right number of elements';
-is @methods[3].WHAT, Array, 'forth item is an array';
+is @methods[3].WHAT.gist, Array.gist, 'forth item is an array';
is +@methods[3], 1, 'nested array for C had right number of elements';
is @methods[2], B.^methods(:tree), 'nested tree for B is correct';
is @methods[3], C.^methods(:tree), 'nested tree for C is correct';
View
22 S12-methods/what.t
@@ -44,28 +44,28 @@ This test tests the C<WHAT> builtin.
my $o = Foo.new;
is($o."WHAT"(), 'Bar', '."WHAT" calls the method instead of the macro');
#?rakudo todo '.WHAT not (easily overridable)'
- is($o.WHAT, 'Foo', '.WHAT still works as intended');
+ is($o.WHAT.gist, 'Foo()', '.WHAT still works as intended');
my $meth = "WHAT";
#?rakudo skip 'indirect method calls'
is($o.$meth, 'Bar', '.$meth calls the method instead of the macro');
}
# these used to be Rakudo regressions, RT #62006
-
{
# proto as a term
lives_ok { Match }, 'proto as a term lives';
lives_ok { +Match }, 'numification of proto lives';
isa_ok ("bac" ~~ /a/).WHAT, Match, '.WHAT on a Match works';
- is +("bac" ~~ /a/).WHAT, 0, 'numification of .WHAT of a Match works';
+ is +("bac" ~~ /a/).WHAT.gist, 0, 'numification of .WHAT of a Match works';
}
+#?rakudo skip 'nom regression'
ok &infix:<+>.WHAT ~~ Multi, '.WHAT of built-in infix op is Multi (RT 66928)';
# RT #69915
{
- sub rt69915f( $a, $b ) { return WHAT($a) ~ '~' ~ WHAT($b) }
- sub rt69915m( $a, $b ) { return $a.WHAT ~ '~' ~ $b.WHAT }
+ sub rt69915f( $a, $b ) { return WHAT($a).gist ~ '~' ~ WHAT($b).gist }
+ sub rt69915m( $a, $b ) { return $a.WHAT.gist ~ '~' ~ $b.WHAT.gist }
is rt69915m( a => 42, 23 ), 'Int()~Int()', 'WHAT method on ints';
@@ -75,24 +75,24 @@ ok &infix:<+>.WHAT ~~ Multi, '.WHAT of built-in infix op is Multi (RT 66928)';
is rt69915f( :a, 23 ), 'Bool()~Int()', 'WHAT function on bool and int';
is rt69915m( :a, 23 ), 'Bool()~Int()', 'WHAT method on bool and int';
- sub wm($x) { return $x.WHAT }
+ sub wm($x) { return $x.WHAT.gist }
sub rt69915wm( $a, $b ) { return wm($a) ~ '~' ~ wm($b) }
is rt69915wm( a => 42, 23 ), 'Int()~Int()', 'WHAT method on ints via func';
- sub wf($x) { return WHAT($x) }
+ sub wf($x) { return WHAT($x).gist }
sub rt69915wf( $a, $b ) { return wf($a) ~ '~' ~ wf($b) }
is rt69915wf( a => 42, 23 ), 'Int()~Int()', 'WHAT func on ints via func';
}
-is 6.02e23.WHAT, Num, 'decimal using "e" is a Num';
-is 1.23456.WHAT, Rat, 'decimal without "e" is Rat';
+is 6.02e23.WHAT.gist, Num.gist, 'decimal using "e" is a Num';
+is 1.23456.WHAT.gist, Rat.gist, 'decimal without "e" is Rat';
ok 1.1 == 11/10, 'decimal == the equivalent rational';
# RT #70237
{
- is ~1.WHAT, 'Int()', '1.WHAT sanity';
+ is 1.WHAT.gist, 'Int()', '1.WHAT sanity';
dies_ok { Int.WHAT = Str }, '.WHAT is readonly';
- is ~2.WHAT, 'Int()', 'assignment to Int.WHAT does nothing';
+ is 2.WHAT.gist, 'Int()', 'assignment to Int.WHAT does nothing';
}
{
View
2  S14-roles/instantiation.t
@@ -25,7 +25,7 @@ role SampleRole {
my $obj2 = SampleRole.new;
ok $obj.WHAT === $obj2.WHAT, "Punned role classes have the same .WHAT";
- is ~$obj.WHAT, 'SampleRole()', '.WHAT as a string gives the name of the role';
+ is $obj.WHAT.gist, 'SampleRole()', '.WHAT as a string gives the name of the role';
}
role WithAttr {
View
2  S14-roles/namespaced.t
@@ -15,7 +15,7 @@ role A::B {
};
#?rakudo todo 'nom regression'
-is(A::B.WHAT, 'B()', 'A::B.WHAT stringifies to short name B');
+is(A::B.WHAT.gist, 'B()', 'A::B.WHAT stringifies to short name B');
class X does A::B {
}
View
2  S32-array/create.t
@@ -12,7 +12,7 @@ built-in "Array" tests
plan 3;
my $array_obj = Array.new(4, 5, 6);
-is($array_obj.WHAT, Array, 'Creating a new list object with new works.');
+is($array_obj.WHAT.gist, Array.gist, 'Creating a new list object with new works.');
is($array_obj, list(4, 5, 6), 'The list object contains the right values.');
is(+$array_obj, 3, 'Finding the length functions properly.');
View
4 S32-hash/delete.t
@@ -47,11 +47,11 @@ ok !defined(%hash{"a"}), "deleted hash elements are really deleted";
# RT #68482
{
my %rt68482 = 1 => 3;
- is %rt68482.delete(1).WHAT, 3.WHAT, '.delete.WHAT is the element';
+ is %rt68482.delete(1).WHAT.gist, 3.WHAT.gist, '.delete.WHAT is the element';
%rt68482 = 1 => 3;
my $rt68482 = %rt68482.delete(1);
- is $rt68482.WHAT, 3.WHAT, '.WHAT of stored .delete is the element';
+ is $rt68482.WHAT.gist, 3.WHAT.gist, '.WHAT of stored .delete is the element';
}
done;
View
14 S32-hash/kv.t
@@ -54,7 +54,7 @@ Basic C<kv> tests, see S32::Containers.
#?DOES 2
sub test1{
my $pair = boo=>'baz';
- my $type = $pair.WHAT;
+ my $type = $pair.WHAT.gist;
for $pair.kv -> $key, $value {
is($key, 'boo', "test1: $type \$pair got the right \$key");
is($value, 'baz', "test1: $type \$pair got the right \$value");
@@ -65,7 +65,7 @@ test1;
#?DOES 2
sub test2{
my %pair = boo=>'baz';
- my $type = %pair.WHAT;
+ my $type = %pair.WHAT.gist;
my $elems= +%pair;
for %pair.kv -> $key, $value {
is($key, 'boo', "test2: $elems elem $type \%pair got the right \$key");
@@ -78,15 +78,15 @@ my %hash = ('foo' => 'baz');
#?DOES 2
sub test3 (%h){
for %h.kv -> $key, $value {
- is($key, 'foo', "test3: from {+%h}-elem {%h.WHAT} \%h got the right \$key");
- is($value, 'baz', "test3: from {+%h}-elem {%h.WHAT} \%h got the right \$value");
+ is($key, 'foo', "test3: from {+%h}-elem {%h.WHAT.gist} \%h got the right \$key");
+ is($value, 'baz', "test3: from {+%h}-elem {%h.WHAT.gist} \%h got the right \$value");
}
}
test3 %hash;
sub test4 (%h){
for 0..%h.kv.end -> $idx {
- is(%h.kv[$idx], %hash.kv[$idx], "test4: elem $idx of {%h.kv.elems}-elem {%h.kv.WHAT} \%hash.kv correctly accessed");
+ is(%h.kv[$idx], %hash.kv[$idx], "test4: elem $idx of {%h.kv.elems}-elem {%h.kv.WHAT.gist} \%hash.kv correctly accessed");
}
}
#?DOES 2 # ???
@@ -94,8 +94,8 @@ test4 %hash;
# sanity
for %hash.kv -> $key, $value {
- is($key, 'foo', "for(): from {+%hash}-elem {%hash.WHAT} \%hash got the right \$key");
- is($value, 'baz', "for(): from {+%hash}-elem {%hash.WHAT} \%hash got the right \$value");
+ is($key, 'foo', "for(): from {+%hash}-elem {%hash.WHAT.gist} \%hash got the right \$key");
+ is($value, 'baz', "for(): from {+%hash}-elem {%hash.WHAT.gist} \%hash got the right \$value");
}
# The things returned by .kv should be aliases
View
2  S32-hash/push.t
@@ -11,7 +11,7 @@ my %ref2 = (a => [1, 4, 5], b => 2, c => 3);
my ($r, %x);
$r = %x.push: 'a' => 1;
- is $r.WHAT, Hash, 'Hash.push returns hash';
+ is $r.WHAT.gist, Hash.gist, 'Hash.push returns hash';
my %h;
%h.push: 'b', 2, 'a', 1, 'c', 3;
View
4 S32-list/create.t
@@ -12,12 +12,12 @@ built-in "list" tests
plan 6;
my $list_sub = list(1, 2, 3);
-is($list_sub.WHAT, List, '&list() creates a list assignable to a scalar.');
+isa_ok($list_sub, List, '&list() creates a list assignable to a scalar.');
is($list_sub, (1, 2, 3), 'The &list() function created a list.');
is(+$list_sub, 3, 'Finding the length of the list works as expected.');
my $list_obj = List.new(4, 5, 6);
-is($list_obj.WHAT, List, 'Creating a new list object with new works.');
+isa_ok($list_obj, List, 'Creating a new list object with new works.');
is($list_obj, list(4, 5, 6), 'The list object contains the right values.');
is(+$list_obj, 3, 'Finding the length functions properly.');
View
2  S32-num/rat.t
@@ -226,7 +226,7 @@ ok 16/5 eqv 16/5, 'infix:<eqv> works with rats';
# RT #72870
#?rakudo todo 'RT 72870'
-is .88888888888.WHAT, 'Rat()', 'WHAT works on Rat created from 11 digit decimal fraction';
+is .88888888888.WHAT.gist, 'Rat()', 'WHAT works on Rat created from 11 digit decimal fraction';
# RT #74624
{
View
6 S32-str/substr.t
@@ -63,7 +63,7 @@ plan 117;
{
my $r = \substr($str, 0, 5);
- ok(~WHAT($r), '$r is a reference');
+ ok(WHAT($r).gist, '$r is a reference');
is($$r, "gloop", '$r referent is eq to the substring');
#?pugs todo 'scalarrefs are not handled correctly'
@@ -179,7 +179,7 @@ sub l (Int $a) { my $l = $a; return $l }
{
my $r = \substr($str, 0, l(5));
- ok(~WHAT($r), '$r is a reference (substr(Int, StrLen)).');
+ ok(WHAT($r).gist, '$r is a reference (substr(Int, StrLen)).');
is($$r, "gloop", '$r referent is eq to the substring (substr(Int, StrLen)).');
#?pugs todo 'scalarrefs are not handled correctly'
@@ -296,7 +296,7 @@ sub p (Int $a) { my $p = $a; return $p }
is($str, "gloop ding", "lvalue assignment modified original string (substr(Int, StrPos)).");
my $r = \substr($str, 0, p(5));
- ok(~WHAT($r), '$r is a reference (substr(Int, StrPos)).');
+ ok(WHAT($r).gist, '$r is a reference (substr(Int, StrPos)).');
is($$r, "gloop", '$r referent is eq to the substring (substr(Int, StrPos)).');
#?pugs todo 'scalarrefs are not handled correctly'
View
2  integration/advent2009-day01.t
@@ -7,6 +7,6 @@ plan(2);
# say "Hello World";
-is( (10/7).WHAT, 'Rat()', 'WHAT');
+is( (10/7).WHAT.gist, 'Rat()', 'WHAT');
is(([+] (1..999).grep( { $_ % 3 == 0 || $_ % 5 == 0 } )), 233168, 'Project Euler #1');
View
8 integration/advent2009-day14.t
@@ -5,7 +5,7 @@ use Test;
plan 22;
-is (3/7).WHAT, "Rat()";
+is (3/7).WHAT.gist, "Rat()";
is_approx (3/7), 0.4285714;
is_approx (3/7).Num + (2/7).Num + (2/7).Num - 1, -1.1102230e-16;
@@ -18,12 +18,12 @@ is (3/7).denominator, 7;
is (3/7).nude.join('|'), "3|7";
my $a = 1/60000 + 1/60000;
-is $a.WHAT, "Rat()";
+is $a.WHAT.gist, "Rat()";
is_approx $a, 3.3333333e-05;
is $a.perl, "1/30000";
$a = 1/60000 + 1/60001;
-is $a.WHAT, "Num()";
+is $a.WHAT.gist, "Num()";
is_approx $a, 3.333305e-05;
ok $a.perl ~~ / '3.3333' /;
@@ -36,7 +36,7 @@ is 3.14.Rat.perl, "157/50";
is pi.Rat.perl, "355/113";
is pi.Rat(1e-10).perl, "312689/99532";
-is 1.75.WHAT, "Rat()";
+is 1.75.WHAT.gist, "Rat()";
is 1.75.perl, "7/4";
is 1.752.perl, "219/125";
View
2  integration/advent2009-day18.t
@@ -37,7 +37,7 @@ class Laptop does BatteryPower does SocketPower {
}
my Laptop $l ;
-is $l.WHAT , 'Laptop()' , 'If we resolve the conflict we can create laptops';
+is $l.WHAT.gist , 'Laptop()' , 'If we resolve the conflict we can create laptops';
role Cup[::Contents] { }
role Glass[::Contents] { }

0 comments on commit f85b8bf

Please sign in to comment.
Something went wrong with that request. Please try again.