Add the support to parsing a null value as std::string.

Fixes #590.
This commit is contained in:
Chen
2020-07-16 22:15:39 +08:00
committed by GitHub
parent 4571e8177a
commit 33315286ab
2 changed files with 6 additions and 0 deletions

View File

@@ -314,6 +314,8 @@ TEST(NodeTest, IncorrectFlow) {
TEST(NodeTest, LoadTildeAsNull) {
Node node = Load("~");
ASSERT_TRUE(node.IsNull());
EXPECT_EQ(node.as<std::string>(), "null");
EXPECT_EQ(node.as<std::string>("~"), "null");
}
TEST(NodeTest, LoadNullWithStrTag) {