mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-03-09 19:24:23 +01:00
Add a failed case
This commit is contained in:
parent
05ae593583
commit
602f87545e
@ -870,6 +870,7 @@ private:
|
||||
|
||||
if (CurrentContext().valueSchema)
|
||||
PushSchema(*CurrentContext().valueSchema);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -425,3 +425,13 @@ TEST(SchemaValidator, Null) {
|
||||
VALIDATE(s, "0", false);
|
||||
VALIDATE(s, "\"\"", false);
|
||||
}
|
||||
|
||||
TEST(SchemaValidator, ObjectInArray) {
|
||||
Document sd;
|
||||
sd.Parse("{\"type\":\"array\", \"items\": { \"type\":\"string\" }}");
|
||||
Schema s(sd);
|
||||
|
||||
VALIDATE(s, "[]", true);
|
||||
VALIDATE(s, "[1]", false);
|
||||
VALIDATE(s, "[{}]", false);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user