1Test2::Compare::Bag(3)User Contributed Perl DocumentationTest2::Compare::Bag(3)
2
3
4
6 Test2::Compare::Bag - Internal representation of a bag comparison.
7
9 This module is an internal representation of a bag for comparison
10 purposes.
11
13 $bool = $arr->ending
14 $arr->set_ending($bool)
15 Set this to true if you would like to fail when the array being
16 validated has more items than the check. That is, if you check for
17 4 items but the array has 5 values, it will fail and list that
18 unmatched item in the array as unexpected. If set to false then it
19 is assumed you do not care about extra items.
20
21 $arrayref = $arr->items()
22 Returns the arrayref of values to be checked in the array.
23
24 $arr->set_items($arrayref)
25 Accepts an arrayref.
26
27 Note: that there is no validation when using "set_items", it is
28 better to use the "add_item" interface.
29
30 $name = $arr->name()
31 Always returns the string "<BAG>".
32
33 $bool = $arr->verify(got => $got, exists => $bool)
34 Check if $got is an array reference or not.
35
36 $arr->add_item($item)
37 Push an item onto the list of values to be checked.
38
39 @deltas = $arr->deltas(got => $got, convert => \&convert, seen =>
40 \%seen)
41 Find the differences between the expected bag values and those in
42 the $got arrayref.
43
45 The source code repository for Test2-Suite can be found at
46 https://github.com/Test-More/Test2-Suite/.
47
49 Chad Granum <exodist@cpan.org>
50 Gianni Ceccarelli <dakkar@thenautilus.net>
51
53 Chad Granum <exodist@cpan.org>
54 Gianni Ceccarelli <dakkar@thenautilus.net>
55
57 Copyright 2018 Chad Granum <exodist@cpan.org>.
58
59 Copyright 2018 Gianni Ceccarelli <dakkar@thenautilus.net>
60
61 This program is free software; you can redistribute it and/or modify it
62 under the same terms as Perl itself.
63
64 See http://dev.perl.org/licenses/
65
66
67
68perl v5.32.1 2021-01-27 Test2::Compare::Bag(3)