Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

pugs refudge (for "gist")

  • Loading branch information...
commit ede6fd4a13a6c89169089434fe3186936c27ece5 1 parent 7051d3a
Will Coleda coke authored
31 S02-literals/pairs.t
View
@@ -27,23 +27,22 @@ plan 79;
sub f1n (:$a) { $a.WHAT.gist }
sub f1p ( $a) { $a.WHAT.gist }
-#?pugs skip 'gist'
{
- is f1n(a => 42), 'Int()', "'a => 42' is a named";
- is f1n(:a(42)), 'Int()', "':a(42)' is a named";
-
- is f1n(:a), 'Bool()', "':a' is a named";
- is f1n(:!a), 'Bool()', "':!a' is also named";
-
- is f1p("a" => 42), 'Pair()', "'\"a\" => 42' is a pair";
- is f1p(("a") => 42), 'Pair()', "'(\"a\") => 42' is a pair";
- is f1p((a => 42)), 'Pair()', "'(a => 42)' is a pair";
- is f1p(("a" => 42)), 'Pair()', "'(\"a\" => 42)' is a pair";
- is f1p((:a(42)), ), 'Pair()', "'(:a(42))' is a pair";
- is f1p((:a), ), 'Pair()', "'(:a)' is a pair";
- is f1p((:!a), ), 'Pair()', "'(:a)' is also a pair";
- is f1n(:a[1, 2, 3]), 'Array()', ':a[...] constructs an Array value';
- is f1n(:a{b => 3}), 'Hash()', ':a{...} constructs a Hash value';
+ is f1n(a => 42), Int.gist, "'a => 42' is a named";
+ is f1n(:a(42)), Int.gist, "':a(42)' is a named";
+
+ is f1n(:a), Bool.gist, "':a' is a named";
+ is f1n(:!a), Bool.gist, "':!a' is also named";
+
+ is f1p("a" => 42), Pair.gist, "'\"a\" => 42' is a pair";
+ is f1p(("a") => 42), Pair.gist, "'(\"a\") => 42' is a pair";
+ is f1p((a => 42)), Pair.gist, "'(a => 42)' is a pair";
+ is f1p(("a" => 42)), Pair.gist, "'(\"a\" => 42)' is a pair";
+ is f1p((:a(42)), ), Pair.gist, "'(:a(42))' is a pair";
+ is f1p((:a), ), Pair.gist, "'(:a)' is a pair";
+ is f1p((:!a), ), Pair.gist, "'(:a)' is also a pair";
+ is f1n(:a[1, 2, 3]), Array.gist, ':a[...] constructs an Array value';
+ is f1n(:a{b => 3}), Hash.gist, ':a{...} constructs a Hash value';
}
{
2  S02-types/bool.t
View
@@ -51,7 +51,7 @@ is(~Bool::False, 'False', 'Bool stringification (False)');
#?pugs 2 skip '.Str'
is Bool::True.Str, 'True', 'True.Str';
is Bool::False.Str, 'False', 'False.Str';
-#?pugs 2 skip "gist"
+#?pugs 2 todo '.gist'
is Bool::True.gist, 'True', 'True.gist';
is Bool::False.gist, 'False', 'False.gist';
is Bool::True.perl, 'Bool::True', 'True.perl';
11 S02-types/hash.t
View
@@ -37,14 +37,11 @@ ok(%hash4.does(Hash), '%hash4 does Hash');
%hash4 = ("key" => "value");
is(%hash4{"key"}, 'value', '(key => value) separated key/value has creation works');
-#?pugs skip 'gist'
-is( (map { .WHAT.gist } , {"a"=> 1 , "b"=>2}).join(' ') , 'Hash()' , 'Non flattening Hashes do not become Pairs when passed to map');
+is( (map { .WHAT.gist } , {"a"=> 1 , "b"=>2}).join(' ') , Hash.gist , 'Non flattening Hashes do not become Pairs when passed to map');
my $does_not_flatten= {"a"=> 1 , "b"=>2};
-#?pugs skip 'gist'
-is( (map { .WHAT.gist } , $does_not_flatten).join(' ') , 'Hash()' , 'Non flattening Hashes do not become Pairs when passed to map');
+is( (map { .WHAT.gist } , $does_not_flatten).join(' ') , Hash.gist , 'Non flattening Hashes do not become Pairs when passed to map');
my %flattens= ("a"=> 1 , "b"=>2);
-#?pugs skip 'gist'
-is( (map { .WHAT.gist } , %flattens).join(' ') , 'Pair() Pair()' , 'Flattening Hashes become Pairs when passed to map');
+is( (map { .WHAT.gist } , %flattens).join(' ') , Pair.gist ~ ' ' ~ Pair.gist, 'Flattening Hashes become Pairs when passed to map');
# hash slicing
@@ -161,12 +158,10 @@ is(%hash10<1>, 2, "assignment of pointy qw to hash");
sub test1 {
my %sane = hash ('a'=>'b');
- #?pugs skip '.gist'
is(%sane.WHAT.gist,Hash.gist,'%sane is a Hash');
}
sub test2 (%hash) {
- #?pugs skip '.gist'
is(%hash.WHAT.gist,Hash.gist,'%hash is a Hash');
}
3  S02-types/range.t
View
@@ -8,9 +8,8 @@ plan 124;
# L<S02/Immutable types/A pair of Ordered endpoints>
my $r = 1..5;
-#?pugs skip 'Range'
+#?pugs 2 skip 'Range'
isa_ok $r, Range, 'Type';
-#?pugs skip 'gist'
is $r.WHAT.gist, Range.gist, 'Type';
#?pugs todo
is $r.perl, '1..5', 'canonical representation';
1  S03-operators/context.t
View
@@ -40,7 +40,6 @@ plan 29;
my $a = 3;
my $b = 2;
- #?pugs skip 'gist'
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');
16 S03-operators/range.t
View
@@ -169,12 +169,12 @@ is (1..6 Z 'a' .. 'c').join, '1a2b3c', 'Ranges and infix:<Z>';
'can make range from numeric string vars';
#?pugs todo
is $range.min, $start, 'range starts at start';
- #?pugs skip ".gist"
- is $range.min.WHAT.gist, "Str()", 'range start is a string';
+ #?pugs todo "wrong type"
+ is $range.min.WHAT.gist, Str.gist, 'range start is a string';
#?pugs todo
is $range.max, $end, 'range ends at end';
- #?pugs skip ".gist"
- is $range.max.WHAT.gist, "Str()", 'range end is a string';
+ #?pugs todo "wrong type"
+ is $range.max.WHAT.gist, Str.gist, 'range end is a string';
lives_ok { "$range" }, 'can stringify range';
#?pugs todo
is ~$range, "100.B 101.B 102.B", 'range is correct';
@@ -225,12 +225,12 @@ is (1..6 Z 'a' .. 'c').join, '1a2b3c', 'Ranges and infix:<Z>';
'can make range from match vars with string context forced';
#?pugs todo
is $range.min, 1, 'range starts at one';
- #?pugs skip 'gist'
- is $range.min.WHAT.gist, "Str()", 'range start is a string';
+ #?pugs todo 'wrong type'
+ is $range.min.WHAT.gist, Str.gist, 'range start is a string';
#?pugs todo
is $range.max, 3, 'range ends at three';
- #?pugs skip 'gist'
- is $range.max.WHAT.gist, "Str()", 'range end is a string';
+ #?pugs todo 'wrong type'
+ is $range.max.WHAT.gist, Str.gist, 'range end is a string';
lives_ok { "$range" }, 'can stringify range';
#?pugs todo
is ~$range, "1 2 3", 'range is correct';
13 S04-statements/for.t
View
@@ -280,19 +280,20 @@ class TestClass{ has $.key is rw };
# list context
-#?pugs skip '.gist'
{
my $a = '';
- for 1..3, 4..6 { $a ~= $_.WHAT.gist };
- is($a, 'Int()Int()Int()Int()Int()Int()', 'List context');
+ my $b = '';
+ for 1..3, 4..6 { $a ~= $_.WHAT.gist ; $b ~= Int.gist };
+ is($a, $b, 'List context');
$a = '';
for [1..3, 4..6] { $a ~= $_.WHAT.gist };
- is($a, 'Array()', 'List context');
+ is($a, Array.gist, 'List context');
$a = '';
- for [1..3], [4..6] { $a ~= $_.WHAT.gist };
- is($a, 'Array()Array()', 'List context');
+ $b = '';
+ for [1..3], [4..6] { $a ~= $_.WHAT.gist ; $b ~= Array.gist };
+ is($a, $b, 'List context');
}
{
1  S06-other/anon-hashes-vs-blocks.t
View
@@ -33,7 +33,6 @@ ok $bar ~~ Hash, '%foo in a block causes hash composing';
%hash<bar> //= hash;
my $h_ref;
$h_ref //= hash();
- #?pugs 3 skip 'gist'
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");
1  S12-class/instantiate.t
View
@@ -42,7 +42,6 @@ is($foo2.check(), 42, 'initializing attributes in new');
# RT 65224
#instantiation from class name unexpectedly creates a class object instead of Str object
-#?pugs skip 'gist'
{
class Foo { };
my $x = 'Foo';
2  S12-class/lexical.t
View
@@ -30,7 +30,7 @@ eval_dies_ok '{ my class B {}; B.new; }; B.new',
ok $pint ~~ WeissBier, 'can smart-match against lexical class';
is $pint.name, 'Erdinger', 'attribute in lexical class works';
is $pint.describe, 'outstanding flavour', 'method call on lexical class works';
- #?pugs skip 'gist'
+ #?pugs todo 'gist needs parens'
is WeissBier.gist, 'WeissBier()', 'lexical type object stringifies correct';
my class LessThanAmazingWeissBier is WeissBier {
1  S32-hash/delete.t
View
@@ -48,7 +48,6 @@ ok !defined(%hash{"a"}), "deleted hash elements are really deleted";
}
# RT #68482
-#?pugs skip '.gist'
{
my %rt68482 = 1 => 3;
is %rt68482.delete(1).WHAT.gist, 3.WHAT.gist, '.delete.WHAT is the element';
3  S32-num/abs.t
View
@@ -14,7 +14,6 @@ for 0, 0 / 1, 0.0e0, 1, 50, 60.0e0, 99.99 -> $x {
is(abs($x), $x, "got the right absolute value for $x");
is($x.abs, $x, 'got the right absolute value for $x='~$x);
- #?pugs 2 skip '.gist'
is (abs($x)).WHAT.gist, $x.WHAT.gist, 'type of abs($x) agrees with type of $x';
is $x.abs.WHAT.gist, $x.WHAT.gist, 'type of $x.abs agrees with type of $x';
}
@@ -23,7 +22,6 @@ for -1, -50, -60.0e0, -9999 / 100 {
is(abs($_), -$_, "got the right absolute value for $_");
is(.abs, -$_, 'got the right absolute value for $_='~$_);
- #?pugs 2 skip '.gist'
is (abs($_)).WHAT.gist, $_.WHAT.gist, 'type of abs($_) agrees with type of $_';
is $_.abs.WHAT.gist, $_.WHAT.gist, 'type of $_.abs agrees with type of $_';
}
@@ -35,7 +33,6 @@ is( abs(-Inf), Inf, 'absolute value of -Inf is Inf');
is( abs("-10"), 10, 'absolute value of "-10" is 10');
#?rakudo todo "abs(70596).WHAT parsing as abs(70596.WHAT)"
-#?pugs skip '.gist'
is( abs(70596).WHAT.gist, 70596.abs.WHAT.gist, 'abs(x).WHAT parses as x.abs.WHAT' );
done;
3  S32-num/rat.t
View
@@ -257,8 +257,7 @@ ok Rat.new() == 0, 'Rat.new() is 0';
ok 16/5 eqv 16/5, 'infix:<eqv> works with rats';
# RT #72870
-#?pugs skip '.gist'
-is .88888888888.WHAT.gist, 'Rat()', 'WHAT works on Rat created from 11 digit decimal fraction';
+is .88888888888.WHAT.gist, Rat.gist, 'WHAT works on Rat created from 11 digit decimal fraction';
# RT #74624
{
3  S32-str/substr.t
View
@@ -67,7 +67,6 @@ plan 118;
{
my $r = \substr($str, 0, 5);
- #?pugs skip '.gist'
ok(WHAT($r).gist, '$r is a reference');
is($$r, "gloop", '$r referent is eq to the substring');
@@ -186,7 +185,6 @@ sub l (Int $a) { my $l = $a; return $l }
{
my $r = \substr($str, 0, l(5));
- #?pugs skip '.gist'
ok(WHAT($r).gist, '$r is a reference (substr(Int, StrLen)).');
is($$r, "gloop", '$r referent is eq to the substring (substr(Int, StrLen)).');
@@ -309,7 +307,6 @@ 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));
- #?pugs skip '.gist'
ok(WHAT($r).gist, '$r is a reference (substr(Int, StrPos)).');
is($$r, "gloop", '$r referent is eq to the substring (substr(Int, StrPos)).');
Please sign in to comment.
Something went wrong with that request. Please try again.