����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
use strict;
use warnings;
use lib 't/lib';
use Std;
{
check_test(
sub {
cmp_deeply([], bag());
},
{
actual_ok => 1,
diag => "",
},
"empty eq"
);
check_test(
sub {
cmp_deeply(['a', 'b', 'b', ['c', 'd']], bag('b', 'a', ['c', 'd'], 'b'));
},
{
actual_ok => 1,
diag => "",
},
"elem eq"
);
check_test(
sub {
cmp_deeply(['a', [], 'b', 'b'], bag());
},
{
actual_ok => 0,
diag => <<EOM,
Comparing \$data as a Bag
Extra: 'a', 'b', 'b', 1 reference
EOM
},
"empty extra"
);
check_test(
sub {
cmp_deeply([], bag('a', [], 'a', 'b'));
},
{
actual_ok => 0,
diag => <<EOM,
Comparing \$data as a Bag
Missing: 'a', 'a', 'b', 1 reference
EOM
},
"empty missing"
);
check_test(
sub {
cmp_deeply(['a', 'a', 'b', [\"c"], "d", []], bag({}, 'a', [\"c"], 'd', 'd', "e"));
},
{
actual_ok => 0,
diag => <<EOM,
Comparing \$data as a Bag
Missing: 'd', 'e', 1 reference
Extra: 'a', 'b', 1 reference
EOM
},
"extra and missing"
);
check_test(
sub {
cmp_deeply("a", bag());
},
{
actual_ok => 0,
diag => <<EOM,
Comparing \$data as a Bag
got : 'a'
expect : An array to use as a Bag
EOM
},
"no array"
);
check_test(
sub {
cmp_deeply(['a', ['a', 'b', 'b'], ['c', 'd', 'c'], ['a', 'b', 'a']],
bag(bag('c', 'c', 'd'), bag('a', 'b', 'a'), bag('a', 'b', 'b'), 'a')
);
},
{
actual_ok => 1,
diag => '',
},
"bag of bags eq"
);
check_test(
sub {
cmp_deeply(['a', ['a', 'b', 'b'], ['c', 'd', 'c'], ['a', 'b', 'a']],
bag(bag('c', 'd', 'd'), bag('a', 'b', 'a'), bag('a', 'b', 'b'), 'a')
);
},
{
actual_ok => 0,
diag => <<EOM,
Comparing \$data as a Bag
Missing: 1 reference
Extra: 1 reference
EOM
},
"bag of bags not eq"
);
my $b1 = bag('a');
my $b2 = [bag('b')];
$b1->add($b2, $b1);
$b2->[0]->add($b1, $b2);
my $v1 = ['a'];
my $v2 = [['b']];
push(@$v1, $v2, $v1);
push(@{$v2->[0]}, $v1, $v2);
check_test(
sub {
cmp_deeply($v1, $b1);
},
{
actual_ok => 1,
diag => '',
},
"circular double bag eq"
);
$b1->add('b', 'b');
push(@$v1, 'c', 'c');
check_test(
sub {
cmp_deeply($v1, $b1);
},
{
actual_ok => 0,
diag => <<EOM,
Comparing \$data as a Bag
Missing: 'b', 'b'
Extra: 'c', 'c'
EOM
},
"circular double set not eq"
);
check_test(
sub {
cmp_bag([1, 2, 2], [2, 1, 2]);
},
{
actual_ok => 1,
},
"cmp_bag eq"
);
check_test(
sub {
cmp_bag([1, 2, 2], [1, 2, 1, 2]);
},
{
actual_ok => 0,
},
"cmp_bag not eq"
);
check_test(
sub {
cmp_bag([1], [1], 'name1');
},
{
actual_ok => 1,
name => 'name1',
},
"cmp_bag returns name"
);
check_test(
sub {
cmp_bag([1], [2], 'name2');
},
{
actual_ok => 0,
name => 'name2',
},
"cmp_bag returns name"
);
check_test(
sub {
cmp_deeply(['a', 'b', 'c', 'a', 'a', 'b'], superbagof('b', 'a', 'b'));
},
{
actual_ok => 1,
diag => "",
},
"superbagof yes"
);
check_test(
sub {
cmp_deeply(['a', 'b', 'c', 'a'], superbagof('d', 'b', 'd', 'b'));
},
{
actual_ok => 0,
diag => <<'EOM',
Comparing $data as a SuperBag
Missing: 'b', 'd', 'd'
EOM
},
"superbagof no"
);
check_test(
sub {
cmp_deeply(['b', 'a', 'b'], subbagof('a', 'b', 'c', 'a', 'a', 'b' ));
},
{
actual_ok => 1,
diag => "",
},
"subbagof yes"
);
check_test(
sub {
cmp_deeply(['d', 'b', 'd','b'], subbagof('a', 'b', 'c', 'a'));
},
{
actual_ok => 0,
diag => <<'EOM',
Comparing $data as a SubBag
Extra: 'b', 'd', 'd'
EOM
},
"subbagof no"
);
{
check_test(
sub {
cmp_deeply(['a', 'a', 'b', 'c', 'b'], noneof('d', 'e', 'f'));
},
{
actual_ok => 1,
diag => "",
},
"noneof yes"
);
check_test(
sub {
cmp_deeply(['a', 'a', 'b', 'c', 'b'], noneof('b', 'c', 'd', 'e'));
},
{
actual_ok => 0,
diag => <<'EOM',
Comparing $data as a NoneOf
Extra: 'b', 'c'
EOM
},
"noneof no"
);
}
eval {
my @res = run_tests(
sub { cmp_bag([], {}) }
)
};
like($@, qr/Argument 2 to cmp_bag is not an ARRAY ref \(HASH.*\)/,
"check arg 1")
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| lib | Folder | 0755 |
|
|
| 00-report-prereqs.dd | File | 1.3 KB | 0644 |
|
| 00-report-prereqs.t | File | 5.88 KB | 0644 |
|
| all.t | File | 977 B | 0644 |
|
| any.t | File | 934 B | 0644 |
|
| array.t | File | 1.27 KB | 0644 |
|
| array_each.t | File | 522 B | 0644 |
|
| arraylength.t | File | 1.59 KB | 0644 |
|
| bag.t | File | 4.69 KB | 0644 |
|
| bagrecursion.t | File | 255 B | 0644 |
|
| blessed.t | File | 777 B | 0644 |
|
| boolean.t | File | 1.17 KB | 0644 |
|
| cache.t | File | 740 B | 0644 |
|
| circular.t | File | 2.02 KB | 0644 |
|
| class.t | File | 1.55 KB | 0644 |
|
| code.t | File | 968 B | 0644 |
|
| deep_utils.t | File | 557 B | 0644 |
|
| descend.t | File | 1.85 KB | 0644 |
|
| error.t | File | 323 B | 0644 |
|
| hash.t | File | 1.45 KB | 0644 |
|
| hash_each.t | File | 579 B | 0644 |
|
| hashkeys.t | File | 1.07 KB | 0644 |
|
| ignore.t | File | 220 B | 0644 |
|
| import.t | File | 116 B | 0644 |
|
| isa.t | File | 1.88 KB | 0644 |
|
| leaf-wrapper.t | File | 1.3 KB | 0644 |
|
| listmethods.t | File | 2.23 KB | 0644 |
|
| memory.t | File | 656 B | 0644 |
|
| methods.t | File | 2.43 KB | 0644 |
|
| no-clobber-globals.t | File | 527 B | 0644 |
|
| none.t | File | 1.04 KB | 0644 |
|
| notest.t | File | 200 B | 0644 |
|
| notest_extra.t | File | 220 B | 0644 |
|
| notest_withtest.t | File | 347 B | 0644 |
|
| number.t | File | 1.47 KB | 0644 |
|
| reftype.t | File | 408 B | 0644 |
|
| regexp.t | File | 2.87 KB | 0644 |
|
| regexp.t.orig | File | 793 B | 0644 |
|
| regexpref.t | File | 511 B | 0644 |
|
| rt78288_blessed_object.t | File | 310 B | 0644 |
|
| scalar.t | File | 923 B | 0644 |
|
| scalarref.t | File | 692 B | 0644 |
|
| set.t | File | 4.97 KB | 0644 |
|
| shallow.t | File | 1.27 KB | 0644 |
|
| string.t | File | 830 B | 0644 |
|