diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2017-09-19 22:35:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-19 22:35:27 -0700 |
commit | cf1b29dec84f9a027dacdff094bbb6b10a110ed3 (patch) | |
tree | ae3bec38ff60fd2b5692f67746ad4c7037cfd61a | |
parent | fa5a69e73b0dd667ff15062adbc170310d440ee9 (diff) | |
parent | cb54caff01ef37b59889d6949e876b1ff6ee3a65 (diff) |
Merge pull request #2377 from mcos/chore/conformance-null-tests
Conformance Tests for Null Timestamp and Duration JSON Values
-rw-r--r-- | conformance/conformance_test.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/conformance/conformance_test.cc b/conformance/conformance_test.cc index b1ff6883..f1b92056 100644 --- a/conformance/conformance_test.cc +++ b/conformance/conformance_test.cc @@ -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, @@ -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, |