Perl Diver 2.31
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

Test2::Compare::Bag

Name Test2::Compare::Bag
Version 0.000144
Located at /usr/local/share/perl5
File /usr/local/share/perl5/Test2/Compare/Bag.pm
Is Core No
Search CPAN for this module Test2::Compare::Bag
Documentation Test2::Compare::Bag
Module Details Test2::Compare::Bag


NAME

Test2::Compare::Bag - Internal representation of a bag comparison.


DESCRIPTION

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/Test2-Suite/.


MAINTAINERS

Chad Granum
Gianni Ceccarelli


AUTHORS

Chad Granum <exodist@cpan.org>Chad Granum
Gianni Ceccarelli <dakkar@thenautilus.net>Gianni Ceccarelli


COPYRIGHT

Copyright 2018 Chad Granum <exodist@cpan.org>.

Copyright 2018 Gianni Ceccarelli <dakkar@thenautilus.net>

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://dev.perl.org/licenses/

Perl Diver brought to you by ScriptSolutions.com © 1997- 2024