Skip to content

Commit ea991d5

Browse files
committed
Merge pull request #378 from whoshuu/add-nil-pack-test
Add test for packing/unpacking nil
2 parents 5e57dc5 + 6a127eb commit ea991d5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/msgpack_basic.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,16 @@ TEST(MSGPACK, simple_buffer_double)
278278
}
279279
}
280280

281+
TEST(MSGPACK, simple_buffer_nil)
282+
{
283+
msgpack::sbuffer sbuf;
284+
msgpack::packer<msgpack::sbuffer> packer(sbuf);
285+
packer.pack_nil();
286+
msgpack::unpacked ret;
287+
msgpack::unpack(ret, sbuf.data(), sbuf.size());
288+
EXPECT_EQ(ret.get().type, msgpack::type::NIL);
289+
}
290+
281291
TEST(MSGPACK, simple_buffer_true)
282292
{
283293
msgpack::sbuffer sbuf;

0 commit comments

Comments
 (0)