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 73809de5c860fd2b52a5b23a862fcc7e36994cfe..aaa255568505073b90b5b1b2a08f29ff263c3c01 100644 |
--- a/components/json_schema/json_schema_validator_unittest.cc |
+++ b/components/json_schema/json_schema_validator_unittest.cc |
@@ -9,9 +9,7 @@ |
class JSONSchemaValidatorCPPTest : public JSONSchemaValidatorTestBase { |
public: |
- JSONSchemaValidatorCPPTest() |
- : JSONSchemaValidatorTestBase(JSONSchemaValidatorTestBase::CPP) { |
- } |
+ JSONSchemaValidatorCPPTest() : JSONSchemaValidatorTestBase() {} |
protected: |
virtual void ExpectValid(const std::string& test_source, |
@@ -134,6 +132,19 @@ TEST(JSONSchemaValidator, IsValidSchema) { |
EXPECT_TRUE(JSONSchemaValidator::IsValidSchema( |
"{" |
" \"type\": \"object\"," |
+ " \"patternProperties\": {" |
+ " \".\": { \"type\": \"any\" }," |
+ " \"foo\": { \"type\": \"any\" }," |
+ " \"^foo$\": { \"type\": \"any\" }," |
+ " \"foo+\": { \"type\": \"any\" }," |
+ " \"foo?\": { \"type\": \"any\" }," |
+ " \"fo{2,4}\": { \"type\": \"any\" }," |
+ " \"(left)|(right)\": { \"type\": \"any\" }" |
+ " }" |
+ "}", &error)) << error; |
+ EXPECT_TRUE(JSONSchemaValidator::IsValidSchema( |
+ "{" |
+ " \"type\": \"object\"," |
" \"unknown attribute\": \"that should just be ignored\"" |
"}", |
JSONSchemaValidator::OPTIONS_IGNORE_UNKNOWN_ATTRIBUTES, |