Test2::Compare::Bag(3pm)

Test2::Compare::Bag3pm

Internal representation of a bag comparison.

Overview

This module is an internal representation of a bag for comparison purposes.

Methods

$bool = $arr->ending
$arr->set_ending($bool)

Set this to true if you would like to fail when the array being validated has more items than the check. That is, if you check for 4 items but the array has 5 values, it will fail and list that unmatched item in the array as unexpected. If set to false then it is assumed you do not care about extra items.

$arrayref = $arr->items()

Returns the arrayref of values to be checked in the array.

$arr->set_items($arrayref)

Accepts an arrayref.

Note: that there is no validation when using "set_items", it is better to use the "add_item" interface.

$name = $arr->name()

Always returns the string "<BAG>".

$bool = $arr->verify(got => $got, exists => $bool)

Check if $got is an array reference or not.

$arr->add_item($item)

Push an item onto the list of values to be checked.

@deltas = $arr->deltas(got => $got, convert => \&convert, seen => \%seen)

Find the differences between the expected bag values and those in the $got arrayref.

Source

The source code repository for Test2-Suite can be found at https://github.com/Test-More/test-more/.

Maintainers

Chad Granum <[email protected]>
Gianni Ceccarelli <[email protected]>

Releases

5 releases since Debian 9 (Stretch); the text changed 4 times.

  1. 9
  2. 10
  3. 11
  4. 12
  5. 13

Authors

Chad Granum <[email protected]>
Gianni Ceccarelli <[email protected]>

From libtest-simple-perl 1.302210-1 in Debian 13 (Trixie). Also shipped by libtest2-suite-perl. Parsed by carta from the page's man source.