Skip to content

Commit

Permalink
Merge pull request #2377 from mcos/chore/conformance-null-tests
Browse files Browse the repository at this point in the history
Conformance Tests for Null Timestamp and Duration JSON Values
  • Loading branch information
xfxyjwf committed Sep 20, 2017
2 parents fa5a69e + cb54caf commit cf1b29d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions conformance/conformance_test.cc
Expand Up @@ -1995,6 +1995,10 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner,
R"({"repeatedDuration": ["1.5s", "-1.5s"]})",
"repeated_duration: {seconds: 1 nanos: 500000000}"
"repeated_duration: {seconds: -1 nanos: -500000000}");
RunValidJsonTest(
"DurationNull", REQUIRED,
R"({"optionalDuration": null})",
"");

ExpectParseFailureForJson(
"DurationMissingS", REQUIRED,
Expand Down Expand Up @@ -2064,6 +2068,10 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner,
"TimestampWithNegativeOffset", REQUIRED,
R"({"optionalTimestamp": "1969-12-31T16:00:00-08:00"})",
"optional_timestamp: {seconds: 0}");
RunValidJsonTest(
"TimestampNull", REQUIRED,
R"({"optionalTimestamp": null})",
"");

ExpectParseFailureForJson(
"TimestampJsonInputTooSmall", REQUIRED,
Expand Down

0 comments on commit cf1b29d

Please sign in to comment.