mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-05-02 07:31:38 +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 Data::MessagePack;
|
||||
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}]));
|
||||
$d->[0]->{x} = 1;
|
||||
ok delete $d->[0]->{x};
|
||||
$d->[0] = 4;
|
||||
my $d = Data::MessagePack->unpack(Data::MessagePack->pack({
|
||||
nil => undef,
|
||||
true => true,
|
||||
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