Commit cf1b29de authored by Feng Xiao's avatar Feng Xiao Committed by GitHub

Merge pull request #2377 from mcos/chore/conformance-null-tests

Conformance Tests for Null Timestamp and Duration JSON Values
parents fa5a69e7 cb54caff
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment