Skip to content

Commit

Permalink
First round of Parcel removal from spectests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Aug 13, 2015
1 parent aeb52e4 commit dfcb18c
Show file tree
Hide file tree
Showing 19 changed files with 32 additions and 33 deletions.
2 changes: 1 addition & 1 deletion S02-literals/listquote-whitespace.t
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ is < foo
>, 'foo', 'various combinations of whitespace are stripped';

# RT #73772
isa-ok < >, Parcel, '< > (only whitespace) is empty Parcel';
isa-ok < >, List, '< > (only whitespace) is empty List';
is < >.elems, 0, ".. and it's really empty";

# vim: ft=perl6
2 changes: 1 addition & 1 deletion S02-literals/listquote.t
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ throws-like { EVAL '<STDIN>' },
# L<S02/Quoting forms/"is autopromoted into">
{
my $c = <a b c>;
isa-ok($c, Parcel, 'List in scalar context becomes a Capture');
isa-ok($c, List, '<a b c> produces a List');
throws-like {$c.push: 'd'},
X::Multi::NoMatch,
'... which is immutable';
Expand Down
2 changes: 1 addition & 1 deletion S02-names-vars/perl.t
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ my @tests = (
#?rakudo emit #
[ { :a(1) }, { :b(2), :c(3) } ],

# a Parcel
# a List
<a b c>
);

Expand Down
2 changes: 1 addition & 1 deletion S02-types/WHICH.t
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ my @normal = <
Pair
PairMap
Parameter
Parcel
Perl
Pod::Block
Pod::Block::Code
Expand All @@ -101,6 +100,7 @@ my @normal = <
Regex
Routine
Scalar
Seq
Set
SetHash
Signature
Expand Down
2 changes: 1 addition & 1 deletion S02-types/array_ref.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plan 45;
# array_ref of strings

my $array_ref1 = ("foo", "bar", "baz");
isa-ok($array_ref1, Parcel);
isa-ok($array_ref1, List);

is(+$array_ref1, 3, 'the array_ref1 has 3 elements');
is($array_ref1[0], 'foo', 'got the right value at array_ref1 index 0');
Expand Down
4 changes: 2 additions & 2 deletions S02-types/bag.t
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,9 @@ sub showkv($x) {
my %x = "a" => 1, "b" => 2;
isa-ok %x.Bag, Bag, "Method .Bag works on Hash-1";
is showkv(%x.Bag), "a:1 b:2", "Method .Bag works on Hash-2";
isa-ok (@a, %x).Bag, Bag, "Method .Bag works on Parcel-1";
isa-ok (@a, %x).Bag, Bag, "Method .Bag works on List-1";
is showkv((@a, %x).Bag), "Now:1 Paradise:1 a:1 b:2 cross-handed:1 set:1 the:2 was:1 way:1",
"Method .Bag works on Parcel-2";
"Method .Bag works on List-2";
}

#?niecza skip '.total/.minpairs/.maxpairs/.fmt NYI'
Expand Down
4 changes: 2 additions & 2 deletions S02-types/baghash.t
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,9 @@ sub showkv($x) {
my %x = "a" => 1, "b" => 2;
isa-ok %x.BagHash, BagHash, "Method .BagHash works on Hash-1";
is showkv(%x.BagHash), "a:1 b:2", "Method .BagHash works on Hash-2";
isa-ok (@a, %x).BagHash, BagHash, "Method .BagHash works on Parcel-1";
isa-ok (@a, %x).BagHash, BagHash, "Method .BagHash works on List-1";
is showkv((@a, %x).BagHash), "Now:1 Paradise:1 a:1 b:2 cross-handed:1 set:1 the:2 was:1 way:1",
"Method .BagHash works on Parcel-2";
"Method .BagHash works on List-2";
}

#?niecza skip '.total/.minpairs/.maxpairs/.fmt NYI'
Expand Down
12 changes: 6 additions & 6 deletions S02-types/lists.t
Original file line number Diff line number Diff line change
Expand Up @@ -138,23 +138,23 @@ plan 32;
}

{
sub Parcel::rt62836 { 62836 }
sub List::rt62836 { 62836 }

throws-like { <1 2 3>.rt62836 },
X::Method::NotFound,
'call to user-declared sub in Parcel:: class dies';
'call to user-declared sub in List:: class dies';
try { EVAL '<1 2 3>.rt62836' };
ok "$!" ~~ /rt62836/, 'error message contains name of sub';
ok "$!" ~~ /Parcel/, 'error message contains name of class';
ok "$!" ~~ /List/, 'error message contains name of class';

augment class Parcel { method rt62836_x { 62836 } };
is <1 2 3>.rt62836_x, 62836, 'call user-declared method in Parcel:: class';
augment class List { method rt62836_x { 62836 } };
is <1 2 3>.rt62836_x, 62836, 'call user-declared method in List:: class';
}

# RT #66304
{
my $rt66304 = (1, 2, 4);
isa-ok $rt66304, Parcel, 'List assigned to scalar is-a Parcel';
isa-ok $rt66304, List, 'List assigned to scalar is-a List';
is( $rt66304.WHAT.perl, (1, 2, 4).WHAT.perl,
'List.WHAT is the same as .WHAT of list assigned to scalar' );
throws-like { $rt66304[1] = 'ro' },
Expand Down
4 changes: 2 additions & 2 deletions S02-types/mix.t
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,9 @@ sub showkv($x) {
my %x = "a" => 1, "b" => 2;
isa-ok %x.Mix, Mix, "Method .Mix works on Hash-1";
is showkv(%x.Mix), "a:1 b:2", "Method .Mix works on Hash-2";
isa-ok (@a, %x).Mix, Mix, "Method .Mix works on Parcel-1";
isa-ok (@a, %x).Mix, Mix, "Method .Mix works on List-1";
is showkv((@a, %x).Mix), "Now:1 Paradise:1 a:1 b:2 cross-handed:1 set:1 the:2 was:1 way:1",
"Method .Mix works on Parcel-2";
"Method .Mix works on List-2";
}

#?niecza skip '.total/.minpairs/.maxpairs/.fmt NYI'
Expand Down
4 changes: 2 additions & 2 deletions S02-types/mixhash.t
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,9 @@ sub showkv($x) {
my %x = "a" => 1, "b" => 2;
isa-ok %x.MixHash, MixHash, "Method .MixHash works on Hash-1";
is showkv(%x.MixHash), "a:1 b:2", "Method .MixHash works on Hash-2";
isa-ok (@a, %x).MixHash, MixHash, "Method .MixHash works on Parcel-1";
isa-ok (@a, %x).MixHash, MixHash, "Method .MixHash works on List-1";
is showkv((@a, %x).MixHash), "Now:1 Paradise:1 a:1 b:2 cross-handed:1 set:1 the:2 was:1 way:1",
"Method .MixHash works on Parcel-2";
"Method .MixHash works on List-2";
}

#?niecza skip '.total/.minpairs/.maxpairs/.fmt NYI'
Expand Down
2 changes: 1 addition & 1 deletion S02-types/multi_dimensional_array.t
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ is(+$multi2, 2, 'the multi2 has 2 elements');
is(+$array, 3, 'multi2[0] has 3 elements');
is(+$multi2[0], 3, '+$multi2[0] works');
}
isa-ok($multi2[0], Parcel);
isa-ok($multi2[0], List);

# slice

Expand Down
4 changes: 2 additions & 2 deletions S02-types/set.t
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ dies-ok { set(1, 2) «+» set(3, 4) }, 'Set «+» Set is illegal';
my %x = "a" => 1, "b" => 2;
isa-ok %x.Set, Set, "Method .Set works on Hash-1";
is showset(%x.Set), "a b", "Method .Set works on Hash-2";
isa-ok (@a, %x).Set, Set, "Method .Set works on Parcel-1";
is showset((@a, %x).Set), "Now Paradise a b cross-handed set the was way", "Method .Set works on Parcel-2";
isa-ok (@a, %x).Set, Set, "Method .Set works on List-1";
is showset((@a, %x).Set), "Now Paradise a b cross-handed set the was way", "Method .Set works on List-2";
}

#?niecza skip '.total/.minpairs/.maxpairs/.fmt NYI'
Expand Down
4 changes: 2 additions & 2 deletions S02-types/sethash.t
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ sub showset($s) { $s.keys.sort.join(' ') }
my %x = "a" => 1, "b" => 2;
isa-ok %x.SetHash, SetHash, "Method .SetHash works on Hash-1";
is showset(%x.SetHash), "a b", "Method .SetHash works on Hash-2";
isa-ok (@a, %x).SetHash, SetHash, "Method .SetHash works on Parcel-1";
is showset((@a, %x).SetHash), "Now Paradise a b cross-handed set the was way", "Method .SetHash works on Parcel-2";
isa-ok (@a, %x).SetHash, SetHash, "Method .SetHash works on List-1";
is showset((@a, %x).SetHash), "Now Paradise a b cross-handed set the was way", "Method .SetHash works on List-2";
}

#?niecza skip '.total/.minpairs/.maxpairs/.fmt NYI'
Expand Down
3 changes: 1 addition & 2 deletions S02-types/sigils-and-types.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 28;
plan 27;

my $scalar;
ok $scalar.WHAT === Any, 'unitialized $var does Mu';
Expand All @@ -27,7 +27,6 @@ ok $scalar ~~ Any, 'value contained in a $var does Mu';
ok EVAL('List').does(Positional), "List does Positional";
ok EVAL('Array').does(Positional), "Array does Positional";
ok EVAL('Range').does(Positional), "Range does Positional";
ok EVAL('Parcel').does(Positional), "Parcel does Positional";
#?niecza skip 'Undeclared name Buf'
ok EVAL('Buf').does(Positional), "Buf does Positional";
#?rakudo todo "Capture does Positional RT #124484"
Expand Down
2 changes: 1 addition & 1 deletion S02-types/whatever.t
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ isa-ok (1..*-1)(10), Range, '(1..*-1)(10) is a Range';
is @a[1..*], 2..4, '@a[1..*] skips first element, stops at last';
is @a, 1..4, 'array is unmodified after reference to [1..*]';
# RT #61844
is (0, 1)[*-1..*], 1, '*-1..* lives and clips to range of Parcel';
is (0, 1)[*-1..*], 1, '*-1..* lives and clips to range of List';
}

# RT #68894
Expand Down
2 changes: 1 addition & 1 deletion S03-metaops/hyper.t
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ is ((1, 2) >>[+]<< (100, 200)).join(','), '101,202',

# RT #123178
{
is 42 «~~« (Array, List, Parcel), (False, False, False), "hyper against an undefined Iterable doesn't hang";
is 42 «~~« (Array, List, Seq), (False, False, False), "hyper against an undefined Iterable doesn't hang";
is 42 «~~« (Hash, Bag, Enum), (False, False, False), "hyper against an undefined Associative doesn't hang";
}

Expand Down
2 changes: 1 addition & 1 deletion S03-metaops/zip.t
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ is (2, 10, * Z* 3, 4, 5, *).munch(5),
}

# RT #75818
isa-ok (1 Z 2)[0], Parcel, 'zip returns a list of parcels';
isa-ok (1 Z 2)[0], List, 'zip returns a list of lists';

# RT #113800 - multiple Z operators work with list associative
#?niecza skip "Unable to resolve method lol in type Parcel"
Expand Down
4 changes: 2 additions & 2 deletions integration/advent2013-day07.t
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ is <a b c> ⊆ <a b d>, False, 'a b c ⊆ a b d';

# in the advent article, it returned False. Since then, S07:55
#
# "A C<Parcel> is immutable, although the elements of a C<Parcel>
# "A C<List> is immutable, although the elements of a C<List>
# may be either mutable or immutable."
#
# is interpreted in such a way that Parcels have become value based,
# is interpreted in such a way that Lists have become value based,
# and that means that this test should return True
is <a b c> === <a b c>, True, 'a b c === a b c';

Expand Down
4 changes: 2 additions & 2 deletions integration/advent2013-day12.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ is-deeply %h<a>:exists, True, 'exists';
is-deeply %h<a b c>:exists, (True, True, False), 'exists - slice';

isa-ok ((%h<a>:exists).WHAT), Bool, 'exists type';
isa-ok ((%h<a b c>:exists).WHAT), Parcel, 'exists type - slice';
isa-ok ((%h<a b c>:exists).WHAT), List, 'exists type - slice';

my @a="a";
isa-ok ((%h{@a}:exists).WHAT), Parcel, 'exists type - array';
isa-ok ((%h{@a}:exists).WHAT), List, 'exists type - array';

is-deeply %h<c>:!exists, True, 'does not exist';

Expand Down

0 comments on commit dfcb18c

Please sign in to comment.