Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(501)

Unified Diff: components/json_schema/json_schema_validator_unittest.cc

Issue 39113003: Docserver: Display enum value descriptions in API docs. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/json_schema/json_schema_validator.cc ('k') | components/test/data/json_schema/enum_schema.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/json_schema/json_schema_validator_unittest.cc
diff --git a/components/json_schema/json_schema_validator_unittest.cc b/components/json_schema/json_schema_validator_unittest.cc
index 4844ed1a8887713b85fddc0e9c3ce5633a968e86..6372032c13576b29f56a860d255c19c18c057edd 100644
--- a/components/json_schema/json_schema_validator_unittest.cc
+++ b/components/json_schema/json_schema_validator_unittest.cc
@@ -77,10 +77,16 @@ TEST(JSONSchemaValidator, IsValidSchema) {
EXPECT_FALSE(JSONSchemaValidator::IsValidSchema(
"{"
" \"type\": \"string\","
- " \"enum\": [ {} ]," // "enum" must contain simple values.
+ " \"enum\": [ {} ]" // "enum" dict values must contain "name".
"}", &error));
EXPECT_FALSE(JSONSchemaValidator::IsValidSchema(
"{"
+ " \"type\": \"string\","
+ " \"enum\": [ { \"name\": {} } ]" // "enum" name must be a simple value.
+ "}",
+ &error));
+ EXPECT_FALSE(JSONSchemaValidator::IsValidSchema(
+ "{"
" \"type\": \"array\","
" \"items\": [ 123 ]," // "items" must contain a schema or schemas.
"}", &error));
@@ -106,7 +112,7 @@ TEST(JSONSchemaValidator, IsValidSchema) {
" },"
" \"enum-property\": {"
" \"type\": \"integer\","
- " \"enum\": [0, 1, 10, 100]"
+ " \"enum\": [0, 1, {\"name\": 10}, 100]"
" },"
" \"items-property\": {"
" \"type\": \"array\","
« no previous file with comments | « components/json_schema/json_schema_validator.cc ('k') | components/test/data/json_schema/enum_schema.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698