mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-05-02 23:42:31 +02:00
perl: more tests for nil/true/false entities
This commit is contained in:
parent
a1c4d8696a
commit
6379d0fe0f
@ -1,12 +1,23 @@
|
|||||||
use Test::More;
|
use Test::More;
|
||||||
use Data::MessagePack;
|
use Data::MessagePack;
|
||||||
use t::Util;
|
use t::Util;
|
||||||
no warnings 'uninitialized'; # i need this. i need this.
|
|
||||||
|
|
||||||
plan tests => 1;
|
plan tests => 4;
|
||||||
|
|
||||||
my $d = Data::MessagePack->unpack(Data::MessagePack->pack([{x => undef}]));
|
my $d = Data::MessagePack->unpack(Data::MessagePack->pack({
|
||||||
$d->[0]->{x} = 1;
|
nil => undef,
|
||||||
ok delete $d->[0]->{x};
|
true => true,
|
||||||
$d->[0] = 4;
|
false => false,
|
||||||
|
foo => [undef, true, false],
|
||||||
|
}));
|
||||||
|
|
||||||
|
$d->{nil} = 42;
|
||||||
|
is $d->{nil}, 42;
|
||||||
|
|
||||||
|
$d->{true} = 43;
|
||||||
|
is $d->{true}, 43;
|
||||||
|
|
||||||
|
$d->{false} = 44;
|
||||||
|
is $d->{false}, 44;
|
||||||
|
|
||||||
|
is_deeply $d->{foo}, [undef, true, false];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user