From ed6fdb6d78d32c25c7e6482dbe3e2b0fe49f8bff Mon Sep 17 00:00:00 2001 From: Milo Yip Date: Sun, 17 Apr 2016 09:09:25 +0800 Subject: [PATCH] Improve coverage for SchemaValidator:::AppendToken() --- test/unittest/schematest.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/unittest/schematest.cpp b/test/unittest/schematest.cpp index 4ceacd6..ff8b5d6 100644 --- a/test/unittest/schematest.cpp +++ b/test/unittest/schematest.cpp @@ -960,6 +960,19 @@ TEST(SchemaValidator, AllOf_Nested) { INVALIDATE(s, "123", "", "allOf", ""); } +TEST(SchemaValidator, EscapedPointer) { + Document sd; + sd.Parse( + "{" + " \"type\": \"object\"," + " \"properties\": {" + " \"~/\": { \"type\": \"number\" }" + " }" + "}"); + SchemaDocument s(sd); + INVALIDATE(s, "{\"~/\":true}", "/properties/~0~1", "type", "/~0~1"); +} + template static char* ReadFile(const char* filename, Allocator& allocator) { const char *paths[] = {