mirror of
https://github.com/NixOS/nix
synced 2025-06-26 20:01:15 +02:00
ValidPathInfo
JSON format should use null
not omit field
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com> Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
This commit is contained in:
parent
213a7a87b4
commit
84c65135a5
11 changed files with 98 additions and 54 deletions
|
@ -175,13 +175,16 @@ TEST(optionalValueAt, empty) {
|
|||
TEST(getNullable, null) {
|
||||
auto json = R"(null)"_json;
|
||||
|
||||
ASSERT_EQ(getNullable(json), std::nullopt);
|
||||
ASSERT_EQ(getNullable(json), nullptr);
|
||||
}
|
||||
|
||||
TEST(getNullable, empty) {
|
||||
auto json = R"({})"_json;
|
||||
|
||||
ASSERT_EQ(getNullable(json), std::optional { R"({})"_json });
|
||||
auto * p = getNullable(json);
|
||||
|
||||
ASSERT_NE(p, nullptr);
|
||||
ASSERT_EQ(*p, R"({})"_json);
|
||||
}
|
||||
|
||||
} /* namespace nix */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue