Open FGasper opened 3 years ago
You can use filter_items
to modify the array you're testing. So what
you're looking for is
filter_items { reverse @_ }
On Thu, Feb 25, 2021, 02:20 Felipe Gasper notifications@github.com wrote:
It’d be nice if this could work:
perl -MTest2::V0 -e'my @foo = (1, 2); is( \@foo, array { item -1 => 2 } )'
Seeded srand with seed '20210224' from local date.
not ok 1
Failed test at -e line 1.
+------+------------------+---------+------------------+------+
| PATH | GOT | OP | CHECK | LNs |
+------+------------------+---------+------------------+------+
| | ARRAY(0x1468438) | |
| 1, 1 | | [-1] |
| | 2 | 1 | | [0] | 1 | !exists |
| | | [1] | 2 | !exists |
| | +------+------------------+---------+------------------+------+
Tests were run but no plan was declared and done_testing() was not seen.
Alternatively I guess the thing tested could just be [reverse @$thearray].
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Test-More/test-more/issues/947, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFURPKTVINHSDRKCBT7MLZLTAWJWDANCNFSM4YFP7KVQ .
It’d be nice if this could work:
Alternatively I guess the thing tested could just be
[reverse @$thearray]
.