Permalink
Browse files

Make sure zero-valued pairs are properly ignored in the constructors.

  • Loading branch information...
1 parent 4e26707 commit 49f02a26dab2b321fa8a3f4842e54a02a535a059 @colomon colomon committed Feb 19, 2012
Showing with 6 additions and 6 deletions.
  1. +3 −3 S02-types/bag.t
  2. +3 −3 S02-types/keybag.t
View
@@ -74,19 +74,19 @@ sub showkv($x) {
}
{
- my $b = bag [ foo => 10, bar => 17, baz => 42 ];
+ my $b = bag [ foo => 10, bar => 17, baz => 42, santa => 0 ];
isa_ok $b, Bag, '&Bag.new given an array of pairs produces a Bag';
is showkv($b), 'bar:17 baz:42 foo:10', '... with the right elements';
}
{
- my $b = bag { foo => 10, bar => 17, baz => 42 }.hash;
+ my $b = bag { foo => 10, bar => 17, baz => 42, santa => 0 }.hash;
isa_ok $b, Bag, '&Bag.new given a Hash produces a Bag';
is showkv($b), 'bar:17 baz:42 foo:10', '... with the right elements';
}
{
- my $b = bag { foo => 10, bar => 17, baz => 42 };
+ my $b = bag { foo => 10, bar => 17, baz => 42, santa => 0 };
isa_ok $b, Bag, '&Bag.new given a Hash produces a Bag';
is showkv($b), 'bar:17 baz:42 foo:10', '... with the right elements';
}
View
@@ -97,19 +97,19 @@ sub showkv($x) {
}
{
- my $b = KeyBag.new([ foo => 10, bar => 17, baz => 42 ]);
+ my $b = KeyBag.new([ foo => 10, bar => 17, baz => 42, santa => 0 ]);
isa_ok $b, KeyBag, '&KeyBag.new given an array of pairs produces a KeyBag';
is showkv($b), 'bar:17 baz:42 foo:10', '... with the right elements';
}
{
- my $b = KeyBag.new({ foo => 10, bar => 17, baz => 42 }.hash);
+ my $b = KeyBag.new({ foo => 10, bar => 17, baz => 42, santa => 0 }.hash);
isa_ok $b, KeyBag, '&KeyBag.new given a Hash produces a KeyBag';
is showkv($b), 'bar:17 baz:42 foo:10', '... with the right elements';
}
{
- my $b = KeyBag.new({ foo => 10, bar => 17, baz => 42 });
+ my $b = KeyBag.new({ foo => 10, bar => 17, baz => 42, santa => 0 });
isa_ok $b, KeyBag, '&KeyBag.new given a Hash produces a KeyBag';
is showkv($b), 'bar:17 baz:42 foo:10', '... with the right elements';
}

0 comments on commit 49f02a2

Please sign in to comment.