Skip to content

Commit e10e1fd

Browse files
committed
[v6.d REVIEW] Test return data directly
Instead of converting it to another type and stringifying. Partial origs: d64d2eb ff44772
1 parent b41e6a0 commit e10e1fd

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

S32-list/permutations.t

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@ plan 9;
55

66
# L<S32::Containers/List/=item permutations>
77

8-
is (1, 2, 3).permutations.list.perl, ((1, 2, 3), (1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), (3, 2, 1)).perl, "permutations method";
9-
is permutations(3).list.perl, ((0, 1, 2), (0, 2, 1), (1, 0, 2), (1, 2, 0), (2, 0, 1), (2, 1, 0)).perl, "permutations function";
8+
is-deeply (1, 2, 3).permutations,
9+
((1, 2, 3), (1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), (3, 2, 1)).Seq, 'permutations method';
10+
is-deeply permutations(3),
11+
((0, 1, 2), (0, 2, 1), (1, 0, 2), (1, 2, 0), (2, 0, 1), (2, 1, 0)).Seq, 'permutations function';
1012

11-
is (1,).permutations.list.perl, ((1,),).perl, "permutations method on single element list";
12-
is permutations(1).list.perl, ((0,),).perl, "permutations function with 1 for its argument";
13+
is-deeply (1,).permutations, ((1,),).Seq, 'method on single-element list';
14+
is-deeply () .permutations, ((),) .Seq, 'method on empty list';
15+
is-deeply permutations(1), ((0,),).Seq, 'sub with 1 for its argument';
16+
is-deeply permutations(0), ((),) .Seq, 'sub with 0 for its argument';
1317

14-
is ().permutations.list.perl, ((),).perl, "permutations method on empty list";
15-
is permutations(0).list.perl, ((),).perl, "permutations function with 0 for its argument";
16-
17-
is +().permutations, 1, "there is 1 permutation of empty list";
18-
is +permutations(0), 1, "there is 1 permutation with 0 values";
18+
is-deeply +().permutations, 1, 'there is 1 .permutation of empty list';
19+
is-deeply +permutations(0), 1, 'there is 1 &permutation with 0 values';
1920

2021
# RT #127777
21-
is permutations(-1).list.perl, ((),).perl, "sub permutations with negative argument";
22+
is-deeply permutations(-1), ((),).Seq, '&permutations with negative argument';

0 commit comments

Comments
 (0)