Skip to content

Commit

Permalink
Update test to pass for nlohmann::json v3.11.3
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 693107973
  • Loading branch information
laramiel authored and copybara-github committed Nov 5, 2024
1 parent 3c12710 commit fff09e4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cc/google/fhir/json/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ cc_library(
":fhir_json",
"@com_google_absl//absl/cleanup",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:str_format",
"@com_google_absl//absl/types:optional",
Expand All @@ -61,6 +60,7 @@ cc_test(
deps = [
":json_sax_handler",
":test_matchers",
"@com_google_absl//absl/status",
"@com_google_googletest//:gtest_main",
],
)
Expand Down
3 changes: 3 additions & 0 deletions cc/google/fhir/json/json_sax_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include "google/fhir/json/json_sax_handler.h"

#include <cstddef>
#include <cstdint>
#include <functional>
#include <memory>
#include <optional>
Expand All @@ -25,6 +27,7 @@
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
#include "include/nlohmann/json.hpp"
#include "include/nlohmann/json_fwd.hpp"
Expand Down
7 changes: 5 additions & 2 deletions cc/google/fhir/json/json_sax_handler_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "absl/status/status.h"
#include "google/fhir/json/test_matchers.h"

namespace google {
Expand Down Expand Up @@ -233,8 +234,10 @@ TEST(JsonSaxHandlerTest, DictionaryNestedInArray) {
TEST(JsonSaxHandlerTest, ErrorParseEmptyInput) {
FhirJson json_value;
EXPECT_THAT(ParseJsonValue("", json_value),
IsErrorStatus(absl::StatusCode::kInvalidArgument,
"unexpected end of input"));
testing::AnyOf(IsErrorStatus(absl::StatusCode::kInvalidArgument,
"unexpected end of input"),
IsErrorStatus(absl::StatusCode::kInvalidArgument,
"empty input")));
}

TEST(JsonSaxHandlerTest, ErrorParseInvalidLiteral) {
Expand Down

0 comments on commit fff09e4

Please sign in to comment.