Skip to content
Browse files

pugs fudges

  • Loading branch information...
1 parent 454fdc3 commit e4b089d897fa758c55cd1f4f93dbde85a59deebd @coke coke committed
View
2 S02-literals/string-interpolation.t
@@ -44,7 +44,9 @@ line 4
}
{
+ #?pugs todo
is 'something'.new, '', '"string literal".new just creates an empty string';
+ #?pugs skip 'Cannot cast from VObject'
is +''.new, 0, '... and that strinig works normally';
}
View
9 S02-names/symbolic-deref.t
@@ -50,12 +50,15 @@ my $outer = 'outside';
my $inner = 'inside';
ok ::('Int') === Int, 'can look up a type object with ::()';
+ #?pugs 3 skip 'Invalid sigil ":$"'
is ::('$inner'), $inner, 'can look up lexical from same block';
is ::('$outer'), $outer, 'can look up lexical from outer block';
lives_ok { ::('$outer') = 'new' }, 'Can use ::() as lvalue';
+ #?pugs todo
is $outer, 'new', 'and the assignment worked';
sub c { 'sub c' }; #OK not used
+ #?pugs 2 skip 'Invalid sigil ":&"'
is ::('&c').(), 'sub c', 'can look up lexical sub';
is ::('e'), e, 'Can look up numerical constants';
@@ -68,6 +71,7 @@ my $outer = 'outside';
class A::B { };
+ #?pugs 2 skip 'No such subroutine'
is ::('Outer::Inner').perl, Outer::Inner.perl, 'can look up name with :: (1)';
is ::('A::B').perl, A::B.perl, 'can look up name with :: (1)';
}
@@ -109,10 +113,12 @@ my $outer = 'outside';
#?rakudo skip 'NYI'
{
sub GLOBAL::a_global_sub () { 42 }
+ #?pugs skip 'Invalid sigil'
is ::("&*a_global_sub")(), 42,
"symbolic dereferentiation of globals works (1)";
my $*a_global_var = 42;
+ #?pugs skip 'Invalid sigil'
is ::('$*a_global_var'), 42,
"symbolic dereferentiation of globals works (2)";
}
@@ -120,11 +126,13 @@ my $outer = 'outside';
# Symbolic dereferentiation of globals *without the star*
#?rakudo skip 'NYI'
{
+ #?pugs skip 'Invalid sigil'
cmp_ok ::('$*IN'), &infix:<===>, $*IN,
"symbolic dereferentiation of globals works (3)";
cmp_ok &::("say"), &infix:<===>, &say,
"symbolic dereferentiation of CORE subs works (1)";
+ #?pugs skip "todo"
ok &::("so")(42),
"symbolic dereferentiation of CORE subs works (2)";
is &::("truncate")(3.1), 3,
@@ -153,6 +161,7 @@ my $outer = 'outside';
try { die 'to set $!' };
ok $::("!"), "symbolic dereferentiation works with special chars (1)";
# ok $::!, "symbolic dereferentiation works with special chars (2)";
+ #?pugs skip 'todo'
ok ::("%*ENV"), "symbolic dereferentiation works with special chars (3)";
# ok %::*ENV, "symbolic dereferentiation works with special chars (4)";
}
View
5 S02-types/mixed_multi_dimensional.t
@@ -52,7 +52,9 @@ Some deeper tests were already added.
@array[0] = %hash;
is(+@array, 1, 'the array has one value in it');
+ #?pugs todo
isa_ok(@array[0], Hash);
+ #?pugs 2 skip 'Cannot cast into a Hash'
is(@array[0]{"key"}, 'value', 'got the right value for key');
is(@array[0]<key1>, 'value1', 'got the right value1 for key1');
}
@@ -199,14 +201,15 @@ Some deeper tests were already added.
@array[2]<two>[0]<f><other> = 5;
#?rakudo todo 'isa hash'
isa_ok(@array[1]<two>[0], Hash);
- #?pugs 3 todo 'bug'
#?rakudo todo 'isa hash'
#?niecza todo
+ #?pugs todo
isa_ok(@array[1]<two>[0]<f>, Hash);
#?rakudo 2 todo 'unknown'
#?niecza todo
is(+@array[1]<two>[0], 2, "two keys at level 4");
#?niecza todo 'more keys at level 4'
+ #?pugs todo
is(@array[1]<two>[0]<f><other>, 5, "more keys at level 4");
}
View
8 S02-types/nan.t
@@ -22,19 +22,27 @@ is Inf**0 , 1, "Inf**0 is 1, _not_ NaN";
ok NaN ~~ NaN, 'NaN is a NaN';
nok 4 ~~ NaN, '4 is not a NaN';
+#?pugs skip '.Num'
nok 4.Num ~~ NaN, "4.Num is not a NaN";
isa_ok NaN + 1i, Complex, "NaN + 1i is a Complex number";
+#?pugs todo
ok NaN + 1i ~~ NaN, "NaN + 1i ~~ NaN";
+#?pugs todo
ok NaN ~~ NaN + 1i, "NaN ~~ NaN + 1i";
isa_ok (NaN)i, Complex, "(NaN)i is a Complex number";
+#?pugs todo
ok (NaN)i ~~ NaN, "(NaN)i ~~ NaN";
+#?pugs todo
ok NaN ~~ (NaN)i, "NaN ~~ (NaN)i";
+#?pugs todo
ok (NaN)i ~~ NaN + 1i, "(NaN)i ~~ NaN + 1i";
+#?pugs todo
ok NaN + 1i ~~ (NaN)i, "NaN + 1i ~~ (NaN)i";
+#?pugs todo
ok truncate(NaN) ~~ NaN, 'truncate(NaN) ~~ NaN';
#?rakudo skip 'RT 83446'
View
2 S03-binding/arrays.t
@@ -129,6 +129,7 @@ plan 47;
is ~@array, "a new_value c", "passing an array to a slurpying sub behaves correctly (2)";
}
+#?pugs skip "Can't modify constant item: VUndef"
{
my sub foo (*@args) { push @args, "new_value" }
@@ -229,6 +230,7 @@ plan 47;
# RT #61566
#?niecza todo
+#?pugs todo
{
eval_dies_ok 'my @rt61566 := 1', 'can only bind Positional stuff to @a';
# TODO: check that the error is the right one
View
1 S03-operators/bit.t
@@ -50,6 +50,7 @@ plan 27;
is( 33023 +> 7, 257, 'shift seven bits right' );
}
+#?pugs skip 'No such method in class Rat: "&Num"'
{
# Tests to see if you really can do casts negative floats to unsigned properly
my $neg1 = -1.0.Num;
View
3 S04-blocks-and-statements/pointy.t
@@ -47,6 +47,7 @@ my $s = -> {
dies_ok $s, 'pointy with block control exceptions';
#?rakudo todo 'pointy blocks and last/redo'
#?niecza todo
+#?pugs todo
is $n, 10, "pointy control exceptions ran";
# L<S06/""Pointy blocks""/will return from the innermost enclosing sub or method>
@@ -78,6 +79,7 @@ is $str, 'inner', 'return in pointy returns from enclosing sub';
# -> { $^a, $^b } is illegal; you can't mix real sigs with placeholders,
# and the -> introduces a sig of (). TimToady #perl6 2008-May-24
+#?pugs todo
eval_dies_ok(q{{ -> { $^a, $^b } }}, '-> { $^a, $^b } is illegal');
# RT #61034
@@ -92,6 +94,7 @@ lives_ok {my $x = -> {}; my $y = $x(); },
#?rakudo skip 'Could not find non-existent sub junction'
#?niecza skip 'Could not find non-existent sub junction'
+#?pugs skip 'No such subroutine: "&junction'
{
my @a = any(3, 4);
my $ok = 0;
View
9 S04-phasers/start.t
@@ -6,6 +6,7 @@ plan 21;
# L<S04/"Phasers"/START "runs separately for each clone">
#?rakudo todo '$_ inside START has some issues, it seems'
+#?pugs todo
{
is(eval(q{{
my $str;
@@ -32,6 +33,7 @@ plan 21;
is $var, 2, 'START {} has executed';
$sub(3);
+ #?pugs todo
is $var, 2, "START {} only runs once for each clone";
}
@@ -41,6 +43,7 @@ plan 21;
{
START { $str ~= 'i' }
}
+ #?pugs todo
is $str, 'oi', 'START {} runs when we first try to use a block';
}
@@ -57,7 +60,9 @@ for <first second> {
};
is $sub(), ':oIi', "START block set \$str to 3 ($_ time)";
+ #?pugs todo
is $sub(), ':o', "START wasn't invoked again (1-1) ($_ time)";
+ #?pugs todo
is $sub(), ':o', "START wasn't invoked again (1-2) ($_ time)";
}
@@ -73,7 +78,9 @@ for <first second> {
};
$sub(); $sub();
+ #?pugs todo
is $ran, 1, "START block ran exactly once ($_ time)";
+ #?pugs todo
is $str, 'banana', "START block modified the correct variable ($_ time)";
}
@@ -90,11 +97,13 @@ for <first second> {
is $sub(), 23, 'START {} block set our variable (2)';
#?niecza todo
is $sub(), 23, 'the returned value of START {} still there';
+ #?pugs todo
is $was_in_start, 1, 'our START {} block was invoked exactly once';
}
# Test that START {} blocks are executed only once even if they return undefined
# (the first implementation ran them twice instead).
+#?pugs skip 'No such subroutine: "&Mu"'
{
my $was_in_start;
my $sub = { START { $was_in_start++; Mu } };
View
12 S05-metasyntax/repeat.t
@@ -19,7 +19,9 @@ plan 22;
# L<S05/Bracket rationalization/The general repetition specifier is now>
# Exact repetition
+#?pugs todo
ok("abcabcabcabcd" ~~ m/'abc'**4/, 'Fixed exact repetition');
+#?pugs todo
is $/, 'abc' x 4, '...with the correct capture';
ok(!("abcabcabcabcd" ~~ m/'abc'**5/), 'Fail fixed exact repetition');
#?pugs todo force_todo
@@ -28,6 +30,7 @@ ok("abcabcabcabcd" ~~ m/'abc'**{4}/, 'Fixed exact repetition using closure');
ok(!( "abcabcabcabcd" ~~ m/'abc'**{5}/ ), 'Fail fixed exact repetition using closure');
# Closed range repetition
+#?pugs todo
ok("abcabcabcabcd" ~~ m/'abc'**2..4/, 'Fixed range repetition');
ok(!( "abc" ~~ m/'abc'**2..4/ ), 'Fail fixed range repetition');
#?pugs todo force_todo
@@ -36,6 +39,7 @@ ok("abcabcabcabcd" ~~ m/'abc'**{2..4}/, 'Fixed range repetition using closure');
ok(!( "abc" ~~ m/'abc'**{2..4}/ ), 'Fail fixed range repetition using closure');
# Open range repetition
+#?pugs todo
ok("abcabcabcabcd" ~~ m/'abc'**2..*/, 'Open range repetition');
ok(!( "abcd" ~~ m/'abc'**2..*/ ), 'Fail open range repetition');
#?pugs todo force_todo
@@ -44,19 +48,27 @@ ok("abcabcabcabcd" ~~ m/'abc'**{2..*}/, 'Open range repetition using closure');
ok(!( "abcd" ~~ m/'abc'**{2..*}/), 'Fail open range repetition using closure');
# It is illegal to return a list, so this easy mistake fails:
+#?pugs todo
eval_dies_ok('"foo" ~~ m/o{1,3}/', 'P5-style {1,3} range mistake is caught');
+#?pugs todo
eval_dies_ok('"foo" ~~ m/o{1,}/', 'P5-style {1,} range mistake is caught');
+#?pugs todo
is(~('foo,bar,baz,' ~~ m/[<alpha>+]+ % ','/), 'foo,bar,baz', '% with a term worked');
+#?pugs todo
is(~('foo,bar,baz,' ~~ m/[<alpha>+]+ %% ','/), 'foo,bar,baz,', '%% with a term worked');
+#?pugs todo
is(~('foo, bar,' ~~ m/[<alpha>+]+ % [','\s*]/), 'foo, bar', '% with a more complex term');
#?rakudo 3 skip 'nom regression'
ok 'a, b, c' !~~ /:s^<alpha>+%\,$/, 'with no spaces around %, no spaces can be matched';
+#?pugs todo
ok 'a, b, c' ~~ /:s^ <alpha>+ % \, $/, 'with spaces around %, spaces can be matched';
+#?pugs todo
ok 'a , b ,c' ~~ /:s^ <alpha>+ % \, $/, 'same, but with leading spaces';
# RT #76792
+#?pugs todo
ok ('a b,c,d' ~~ token { \w \s \w+ % \, }), 'can combine % with backslash character classes';
# vim: ft=perl6
View
32 S05-transliteration/trans.t
@@ -50,6 +50,7 @@ is("abcde".trans( ('a..e' => 'A'..'E') ), "ABCDE",
is("ABCDE".trans( (['A' .. 'E'] => "a..e") ), "abcde",
"Using array reference on one side and string range on the other");
+#?pugs todo
is("&nbsp;&lt;&gt;&amp;".trans( (['&nbsp;', '&lt;', '&gt;', '&amp;'] =>
[' ', '<', '>', '&' ])),
" <>&","The array version can map one characters to one-or-more characters");
@@ -59,6 +60,7 @@ is(" <>&".trans( ([' ', '<', '>', '&' ] =>
"&nbsp;&lt;&gt;&amp;",
"The array version can map one-or-more characters to one-or-more characters");
+#?pugs todo
is("&nbsp;&lt;&gt;&amp;".trans( (['&nbsp;', '&nbsp;&lt;', '&lt;', '&gt;', '&amp;'] =>
[' ', 'AB', '<', '>', '&' ])),
"AB>&",
@@ -73,6 +75,7 @@ is("Whfg nabgure Crey unpxre".trans('a..z' => 'n..za..m', 'A..Z' => 'N..ZA..M'),
"Multiple ranges interpreted in string");
# Per S05 changes
+#?pugs todo
{
is("Whfg nabgure Crey unpxre".trans(' a..z' => '_n..za..m', 'A..Z' => 'N..ZA..M'),
"Just_another_Perl_hacker",
@@ -99,9 +102,11 @@ is("\x12c\x190".trans("\x12c" => "\x190"), "\x190\x190");
# should these be combined?
#?rakudo skip 'disambiguate ranges'
#?niecza todo
+#?pugs todo
is($b.trans('A..H..Z' => 'a..h..z'), $a,
'ambiguous ranges combined');
+#?pugs todo
is($b.trans('..H..Z' => '__h..z'),
'ABCDEFGhijklmnopqrstuvwxyz',
'leading ranges interpreted as string');
@@ -109,67 +114,83 @@ is($b.trans('..H..Z' => '__h..z'),
is($b.trans('A..H..' => 'a..h__'), 'abcdefghIJKLMNOPQRSTUVWXYZ',
'trailing ranges interpreted as string');
+#?pugs todo
is($b.trans('..A..H..' => '__a..h__'), 'abcdefghIJKLMNOPQRSTUVWXYZ',
'leading, trailing ranges interpreted as string');
# added as a consequence of RT #76720
+#?pugs todo
is("hello".trans("l" => ""), "heo", "can replace with empty string");
# complement, squeeze/squash, delete
#?rakudo 2 skip 'flags'
#?niecza 2 skip 'trans flags NYI'
+#?pugs todo
is('bookkeeper'.trans(:s, 'a..z' => 'a..z'), 'bokeper',
':s flag (squash)');
+#?pugs todo
is('bookkeeper'.trans(:d, 'ok' => ''), 'beeper',
':d flag (delete)');
+#?pugs todo
is('ABC123DEF456GHI'.trans('A..Z' => 'x'), 'xxx123xxx456xxx',
'no flags');
#?rakudo 4 skip 'flags'
#?niecza 4 skip 'trans flags NYI'
+#?pugs todo
is('ABC123DEF456GHI'.trans(:c, 'A..Z' => 'x'),'ABCxxxDEFxxxGHI',
'... with :c');
+#?pugs todo
is('ABC111DEF222GHI'.trans(:s, '0..9' => 'x'),'ABCxDEFxGHI',
'... with :s');
+#?pugs todo
is('ABC111DEF222GHI'.trans(:c, :s, 'A..Z' => 'x'),'ABCxDEFxGHI',
'... with :s and :c');
+#?pugs todo
is('ABC111DEF222GHI'.trans(:c, :d, 'A..Z' => ''),'ABCDEFGHI',
'... with :d and :c');
+#?pugs todo
is('Good&Plenty'.trans('len' => 'x'), 'Good&Pxxxty',
'no flags');
#?rakudo 5 skip 'flags'
#?niecza 5 skip 'trans flags NYI'
+#?pugs todo
is('Good&Plenty'.trans(:s, 'len' => 'x',), 'Good&Pxty',
'squashing depends on replacement repeat, not searchlist repeat');
+#?pugs todo
is('Good&Plenty'.trans(:s, 'len' => 't'), 'Good&Ptty',
'squashing depends on replacement repeat, not searchlist repeat');
# also checks that :c uses the first element in array (or first char in string)
+#?pugs todo
is("&nbsp;&lt;&gt;&amp;".trans(:c, (['&nbsp;', '&gt;', '&amp;'] =>
['???', 'AB', '>', '&' ])),
'&nbsp;????????????&gt;&amp;',
'array, many-to-many transliteration, complement');
# fence-post issue with complement
+#?pugs todo
is("&nbsp;&lt;&gt;&amp;".trans(:c, (['&nbsp;', '&gt;'] =>
['???', 'AB'])),
'&nbsp;????????????&gt;???????????????',
'fence-post issue (make sure to replace end bits as well)');
-
+
+#?pugs todo
is("&nbsp;&lt;&gt;&amp;".trans(:c, :s, (['&nbsp;', '&gt;', '&amp;'] =>
['???'])),
'&nbsp;???&gt;&amp;',
'... and now complement and squash');
+#?pugs skip 'Not a keyed value: VRule'
{
# remove vowel and character after
is('abcdefghij'.trans(/<[aeiou]> \w/ => ''), 'cdgh', 'basic regex works');
@@ -193,6 +214,7 @@ is("&nbsp;&lt;&gt;&amp;".trans(:c, :s, (['&nbsp;', '&gt;', '&amp;'] =>
#?rakudo skip 'closures and regexes'
#?niecza skip 'closures and regexes'
+#?pugs skip 'Not a keyed value: VRule'
{
# closures and regexes!
is(
@@ -214,6 +236,7 @@ is("&nbsp;&lt;&gt;&amp;".trans(:c, :s, (['&nbsp;', '&gt;', '&amp;'] =>
#?rakudo skip 'tr///, feed operator not implemented'
#?niecza skip 'Action method quote:tr not yet implemented'
{
+ #?pugs todo
is(eval('"abc".trans(<== "a" => "A")'), "Abc",
"you're allowed to leave off the (...) named arg parens when you use <==");
@@ -245,16 +268,20 @@ eval_dies_ok('$_ = "axbycz"; y/abc/def/', 'y/// does not exist any longer');
'trans on subst output lives';
}
+#?pugs todo
is('aaaaabbbbb'.trans(['aaa', 'aa', 'bb', 'bbb'] => ['1', '2', '3', '4']),
'1243',
'longest constant token preferred, regardless of declaration order');
-
+
+#?pugs skip 'Not a keyed value: VRule'
is('foobar'.trans(/\w+/ => 'correct', /foo/ => 'RONG'), 'correct',
'longest regex token preferred, regardless of declaration order');
+#?pugs skip 'Not a keyed value: VRule'
is('aaaa'.trans(/a/ => '1', /\w/ => '2', /./ => '3'), '1111',
'in case of a tie between regex lengths, prefer the first one');
+#?pugs todo
is('ababab'.trans([/ab/, 'aba', 'bab', /baba/] =>
['1', '2', '3', '4' ]),
'23',
@@ -262,6 +289,7 @@ is('ababab'.trans([/ab/, 'aba', 'bab', /baba/] =>
# RT #83674
#?niecza todo 'Not sure what is supposed to be going on here'
+#?pugs todo
lives_ok { my @a = 1..2; @a>>.trans((1..2) => (14..15,1..2)); }, 'trans works with Cool signature';
# vim: ft=perl6
View
8 S12-class/inheritance.t
@@ -52,6 +52,7 @@ lives_ok { $fud = $foo_bar.getme.fud }, 'chained method dispatch on altered meth
is($fud, "Foo::Bar::fud", "returned value is correct");
is $foo_bar.Foo::baz, 'Foo::baz', '$obj.Class::method syntax works';
+#?pugs todo
dies_ok { $foo_bar.Unrelated::something() },
'Cannot call unrelated method with $obj.Class::method syntax';
@@ -60,9 +61,12 @@ dies_ok { $foo_bar.Unrelated::something() },
ok Foo::Bar.isa(Foo), "subclass.isa(superclass) is true";
ok Foo::Bar.isa(Foo::Bar), "subclass.isa(same_subclass) is true";
+#?pugs skip 'No compatible multi variant found: "&isa"'
ok Foo::Bar.HOW.isa(Foo::Bar, Foo), "subclass.HOW.isa(superclass) is true";
+#?pugs skip 'No compatible multi variant found: "&isa"'
ok Foo::Bar.HOW.isa(Foo::Bar, Foo::Bar), "subclass.HOW.isa(same_subclass) is true";
+#?pugs todo
{
my $test = '$obj.$meth is canonical (audreyt says)';
class Abc {
@@ -120,17 +124,21 @@ is(Y.new.k(), 'X', 'inherited method dispatch works inside another class with sa
}
# Make sure inheritance from Mu works (got broken in Rakudo once).
+#?pugs skip 'eval_lives_ok'
eval_lives_ok 'class NotAny is Mu { }; NotAny.new', 'inheritance from Mu works';
{
class DirectMu is Mu { };
ok DirectMu !~~ Any, 'class inheriting from Mu is not Any';
#?niecza skip 'Unable to resolve method parents in class ClassHOW'
+ #?pugs skip 'No such method in class Class: "&parents"'
ok !( any(DirectMu.^parents).gist eq 'Any()'), 'and Any does not appear in the list of parents either';
}
+#?pugs todo
eval_dies_ok 'class RT64642 is ::Nowhere {}', 'dies: class D is ::C {}';
# check that inheriting from Array works
+#?pugs skip "Can't modify constant item: VUndef"
{
class ArrayChild is Array {
method summary() { self.join(', ') }
View
1 S32-hash/delete.t
@@ -48,6 +48,7 @@ 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';
View
2 S32-hash/slice.t
@@ -31,6 +31,7 @@ plan 29;
}
#?niecza skip 'Excess arguments to CORE List.new, used 1 of 3 positionals'
+#?pugs skip 'Must only use named arguments to new() constructor'
{ my %hash;
%hash{(1,2)} = "one", "two";
@@ -49,6 +50,7 @@ plan 29;
#?pugs todo 'feature'
#?rakudo skip 'binding on hash elements unimplemented'
#?niecza todo 'Writing to readonly scalar'
+#?pugs skip "Can't modify constant item: VNum Infinity"
{
my %hash = :a(1), :b(2), :c(3), :d(4);
my @slice := %hash<b c>;
View
19 S32-list/sort.t
@@ -38,6 +38,7 @@ plan 33;
is(@s, @e, 'array of numbers was sorted (using invocant form)');
}
+#?pugs todo
{
my @a = (2, 45, 6, 1, 3);
my @e = (1, 2, 3, 6, 45);
@@ -48,6 +49,7 @@ plan 33;
#?rakudo skip "closure as non-final argument"
#?niecza skip 'Invocant handling is NYI'
+#?pugs todo
{
my @a = (2, 45, 6, 1, 3);
my @e = (1, 2, 3, 6, 45);
@@ -58,6 +60,7 @@ plan 33;
#?rakudo skip "method fallback to sub unimpl"
#?niecza skip 'err, what?'
+#?pugs todo
{
my @a = (2, 45, 6, 1, 3);
my @e = (1, 2, 3, 6, 45);
@@ -66,6 +69,7 @@ plan 33;
is(@s, @e, '... with closure as direct invocant');
}
+#?pugs todo
{
my @a = (2, 45, 6, 1, 3);
my @e = (1, 2, 3, 6, 45);
@@ -74,6 +78,7 @@ plan 33;
is(@s, @e, '... with explicit spaceship (using invocant form)');
}
+#?pugs todo
{
my @a = (2, 45, 6, 1, 3);
my @e = (45, 6, 3, 2, 1);
@@ -82,6 +87,7 @@ plan 33;
is(@s, @e, '... reverse sort with explicit spaceship');
}
+#?pugs todo
{
my @a = (2, 45, 6, 1, 3);
my @e = (45, 6, 3, 2, 1);
@@ -114,6 +120,7 @@ plan 33;
is(@s, @e, 'array of strings was sorted (using invocant form)');
}
+#?pugs todo
{
my @a = <daa boo gaa aaa>;
my @e = <aaa boo daa gaa>;
@@ -122,6 +129,7 @@ plan 33;
is(@s, @e, '... with explicit cmp');
}
+#?pugs todo
{
my @a = <daa boo gaa aaa>;
my @e = <aaa boo daa gaa>;
@@ -131,6 +139,7 @@ plan 33;
}
+#?pugs todo
{
my %a = (4 => 'a', 1 => 'b', 2 => 'c', 5 => 'd', 3 => 'e');
my @e = (4, 1, 2, 5, 3);
@@ -139,6 +148,7 @@ plan 33;
is(@s, @e, '... sort keys by string value');
}
+#?pugs todo
{
my %a = (4 => 'a', 1 => 'b', 2 => 'c', 5 => 'd', 3 => 'e');
my @e = (4, 1, 2, 5, 3);
@@ -147,6 +157,7 @@ plan 33;
is(@s, @e, '... sort keys by string value (using invocant form)');
}
+#?pugs todo
{
my %a = ('a' => 4, 'b' => 1, 'c' => 2, 'd' => 5, 'e' => 3);
my @e = <b c e a d>;
@@ -155,6 +166,7 @@ plan 33;
is(@s, @e, '... sort keys by numeric value');
}
+#?pugs todo
{
my %a = ('a' => 4, 'b' => 1, 'c' => 2, 'd' => 5, 'e' => 3);
my @e = <b c e a d>;
@@ -164,6 +176,7 @@ plan 33;
}
+#?pugs skip '.key'
{
my %map = (p => 1, e => 2, r => 3, l => 4);
@@ -173,10 +186,11 @@ plan 33;
my @s = %map.sort: { .value };
isa_ok(@s[0], Pair, '%hash.sort returns a List of Pairs');
is (@s.map: { .key }).join, 'perl', 'sort with unary sub'
-
}
+
#?niecza todo "Niecza's sort is not stable"
+#?pugs skip 'Cannot cast into Array: VRef'
{
is (<P e r l 6>.sort: { 0; }).join, 'Perl6',
'sort with arity 0 closure is stable';
@@ -198,13 +212,13 @@ plan 33;
## XXX pmichaud, 2008-07-01: .sort should work on non-list values
{
-#?pugs 2 todo 'bug'
is ~42.sort, "42", "method form of sort should work on numbers";
is ~"str".sort, "str", "method form of sort should work on strings";
is ~(42,).sort, "42", "method form of sort should work on parcels";
}
# RT #67010
+#?pugs todo
{
my @list = 1, 2, Code;
lives_ok { @list.sort: { $^a cmp $^b } },
@@ -234,6 +248,7 @@ plan 33;
lives_ok { @sorted = (RT71258_1.new, RT71258_1.new).sort },
'sorting by stringified class instance (name and memory address)';
+ #?pugs skip '.WHERE'
ok ([<] @sorted.map({.WHERE})),
'checking sort order by class memory address';
View
13 S32-num/int.t
@@ -24,12 +24,14 @@ is( eval(0.perl), 0, 'eval 0.perl is 0' );
isa_ok( eval((-0).perl), Int, 'eval -0.perl is Int' );
is( eval((-0).perl), -0, 'eval -0.perl is 0' );
+#?pugs 5 skip '.Int'
is((-1).Int, -1, "(-1).Int is -1");
is(0.Int, 0, "0.Int is 0");
is(1.Int, 1, "1.Int is 1");
is(3.14159265.Int, 3, "3.14159265.Int is 3");
is((-3.14159265).Int, -3, "(-3.14159265).Int is -3");
+#?pugs 6 skip '.Int'
is(0.999.Int, 0, "0.999.Int is 0");
is(0.51.Int, 0, "0.51.Int is 0");
is(0.5.Int, 0, "0.5.Int is 0");
@@ -37,6 +39,7 @@ is(0.49.Int, 0, "0.49.Int is 0");
is(0.1.Int, 0, "0.1.Int is 0");
isa_ok(0.1.Int, Int, '0.1.Int returns an Int');
+#?pugs 6 skip '.Int'
is((-0.999).Int, 0, "(-0.999).Int is 0");
is((-0.51).Int, 0, "(-0.51).Int is 0");
is((-0.5).Int, 0, "(-0.5).Int is 0");
@@ -44,18 +47,21 @@ is((-0.49).Int, 0, "(-0.49).Int is 0");
is((-0.1).Int, 0, "(-0.1).Int is 0");
isa_ok((-0.1).Int, Int, 'int(-0.1) returns an Int');
+#?pugs 5 skip '.Int'
is(1.999.Int, 1, "int(1.999) is 1");
is(1.51.Int, 1, "int(1.51) is 1");
is(1.5.Int, 1, "int(1.5) is 1");
is(1.49.Int, 1, "int(1.49) is 1");
is(1.1.Int, 1, "int(1.1) is 1");
+#?pugs 5 skip '.Int'
is((-1.999).Int, -1, "int(-1.999) is -1");
is((-1.51).Int, -1, "int(-1.51) is -1");
is((-1.5).Int, -1, "int(-1.5) is -1");
is((-1.49).Int, -1, "int(-1.49) is -1");
is((-1.1).Int, -1, "int(-1.1) is -1");
+#?pugs 4 skip '.Int, .Num'
is(1.999.Num.Int, 1, "int(1.999.Num) is 1");
is(1.1.Num.Int, 1, "int(1.1.Num) is 1");
@@ -69,6 +75,7 @@ isa_ok ?1, Bool, "?1 is Bool";
ok ?42, "?42 is true";
isa_ok ?42, Bool, "?42 is Bool";
+#?pugs 6 skip '.Bool'
nok 0.Bool, "0.Bool is false";
isa_ok 0.Bool, Bool, "0.Bool is Bool";
ok 1.Bool, "1.Bool is true";
@@ -76,6 +83,7 @@ isa_ok 1.Bool, Bool, "1.Bool is Bool";
ok 42.Bool, "42.Bool is true";
isa_ok 42.Bool, Bool, "42.Bool is Bool";
+#?pugs 5 skip '.Int'
is('-1.999'.Int, -1, "int('-1.999') is -1");
#?niecza 3 skip "0x, 0d, and 0o NYI"
is('0x123'.Int, 0x123, "int('0x123') is 0x123");
@@ -85,6 +93,8 @@ is('0o678'.Int, 0o67, "int('0o678') is 0o67");
#?niecza skip "trailing d produces a failure"
is('3e4d5'.Int, 3e4, "int('3e4d5') is 3e4");
+#?pugs skip '.Int, .Num'
+#?DOES 24
{
sub __int( $s ) {
my $pos = $s.index('.');
@@ -103,14 +113,17 @@ is('3e4d5'.Int, 3e4, "int('3e4d5') is 3e4");
#?DOES 1
# Special values
+#?pugs skip '.Int'
is((1.9e3).Int, 1900, "int 1.9e3 is 1900");
#?pugs 3 todo 'bug'
#?rakudo 3 todo 'Inf and NaN NYI for Int'
+#?pugs 3 skip '.Int'
is((Inf).Int, Inf, "int Inf is Inf");
is((-Inf).Int, -Inf, "int -Inf is -Inf");
is((NaN).Int, NaN, "int NaN is NaN");
# RT #65132
+#?pugs todo
eval_dies_ok 'int 3.14', 'dies: int 3.14 (prefix:int is gone)';
# vim: ft=perl6
View
22 S32-str/substr.t
@@ -12,17 +12,23 @@ plan 118;
is(substr($str, 0, 0), '', 'Empty string with 0 as thrid arg');
is(substr($str, 3, 0), '', 'Empty string with 0 as thrid arg');
is(substr($str, 0, 1), "f", "first char");
+ #?pugs todo
is(substr($str, *-1), "r", "last char");
+ #?pugs todo
is(substr($str, *-4, 2), "ob", "counted from the end");
is(substr($str, 1, 2), "oo", "arbitrary middle");
is(substr($str, 3), "bar", "length omitted");
is(substr($str, 3, 10), "bar", "length goes past end");
ok(!defined(substr($str, 20, 5)), "substr outside of string");
+ #?pugs todo
ok(!defined(substr($str, *-100, 10)), "... on the negative side");
+ #?pugs todo
is(substr($str, 0, *-2), "foob", "from beginning, with negative length");
+ #?pugs todo
is(substr($str, 2, *-2), "ob", "in middle, with negative length");
is(substr($str, 3, *-3), "", "negative length - gives empty string");
+ #?pugs todo
is(substr($str, *-4, *-1), "oba", "start from the end and negative length");
is($str, "foobar", "original string still not changed");
@@ -61,6 +67,7 @@ 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');
@@ -73,7 +80,9 @@ plan 118;
my $o = \substr($str, 3, 2);
is($$o, "ng", "other ref to other lvalue");
$$r = "foo";
+ #?pugs todo
is($str, "foo ding", "lvalue ref size varies but still works");
+ #?pugs todo
is($$o, " d", "other lvalue wiggled around");
}
@@ -133,11 +142,14 @@ sub l (Int $a) { my $l = $a; return $l }
is(substr($str, 0, l(0)), '', 'Empty string with 0 as thrid arg (substr(Int, StrLen)).');
is(substr($str, 3, l(0)), '', 'Empty string with 0 as thrid arg (substr(Int, StrLen)).');
is(substr($str, 0, l(1)), "f", "first char (substr(Int, StrLen)).");
+ #?pugs todo
is(substr($str, *-1, l(1)), "r", "last char (substr(Int, StrLen)).");
+ #?pugs todo
is(substr($str, *-4, l(2)), "ob", "counted from the end (substr(Int, StrLen)).");
is(substr($str, 1, l(2)), "oo", "arbitrary middle (substr(Int, StrLen)).");
is(substr($str, 3, l(6)), "bar", "length goes past end (substr(Int, StrLen)).");
ok(!defined(substr($str, 20, l(5))), "substr outside of string (substr(Int, StrLen)).");
+ #?pugs todo
ok(!defined(substr($str, *-100, l(5))), "... on the negative side (substr(Int, StrLen)).");
is($str, "foobar", "original string still not changed (substr(Int, StrLen)).");
@@ -174,6 +186,7 @@ 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)).');
@@ -186,7 +199,9 @@ sub l (Int $a) { my $l = $a; return $l }
my $o = \substr($str, 3, l(2));
is($$o, "ng", "other ref to other lvalue (substr(Int, StrLen)).");
$$r = "foo";
+ #?pugs todo
is($str, "foo ding", "lvalue ref size varies but still works (substr(Int, StrLen)).");
+ #?pugs todo
is($$o, " d", "other lvalue wiggled around (substr(Int, StrLen)).");
}
@@ -246,13 +261,16 @@ sub p (Int $a) { my $p = $a; return $p }
{ # read only
my $str = "foobar";
is(substr($str, 0, p(0)), '', 'Empty string with 0 as thrid arg (substr(Int, StrPos)).');
+ #?pugs todo
is(substr($str, 3, p(3)), '', 'Empty string with 0 as thrid arg (substr(Int, StrPos)).');
is(substr($str, 0, p(1)), "f", "first char (substr(Int, StrPos)).");
+ #?pugs todo
is(substr($str, 1, p(3)), "oo", "arbitrary middle (substr(Int, StrPos)).");
is(substr("IMAGINATIVE => Insane Mimicries of Amazingly Gorgeous, Incomplete Networks, Axiomatic Theorems, and Immortally Vivacious Ecstasy", 1, p(2)), "MA", "substr works with named argument (substr(Int, StrPos)).");
is(substr($str, 3, p(6)), "bar", "length goes past end (substr(Int, StrPos)).");
ok(!defined(substr($str, 20, p(5))), "substr outside of string (substr(Int, StrPos)).");
+ #?pugs todo
ok(!defined(substr($str, *-100, p(5))), "... on the negative side (substr(Int, StrPos)).");
is($str, "foobar", "original string still not changed (substr(Int, StrPos)).");
@@ -291,6 +309,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));
+ #?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)).');
@@ -303,7 +322,9 @@ sub p (Int $a) { my $p = $a; return $p }
my $o = \substr($str, 3, p(2));
is($$o, "ng", "other ref to other lvalue (substr(Int, StrPos)).");
$$r = "foo";
+ #?pugs todo
is($str, "foo ding", "lvalue ref size varies but still works (substr(Int, StrPos)).");
+ #?pugs todo
is($$o, " d", "other lvalue wiggled around (substr(Int, StrPos)).");
};
@@ -354,6 +375,7 @@ sub p (Int $a) { my $p = $a; return $p }
}
#?niecza todo
+#?pugs todo
eval_dies_ok 'substr(Any, 0)', 'substr needs Cool as argument';
# vim: ft=perl6

0 comments on commit e4b089d

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