(t *testing.T)
| 82 | } |
| 83 | |
| 84 | func TestEscapePath(t *testing.T) { |
| 85 | json := `{ |
| 86 | "test":{ |
| 87 | "*":"valZ", |
| 88 | "*v":"val0", |
| 89 | "keyv*":"val1", |
| 90 | "key*v":"val2", |
| 91 | "keyv?":"val3", |
| 92 | "key?v":"val4", |
| 93 | "keyv.":"val5", |
| 94 | "key.v":"val6", |
| 95 | "keyk*":{"key?":"val7"} |
| 96 | } |
| 97 | }` |
| 98 | |
| 99 | testEscapePath(t, json, "test.\\*", "valZ") |
| 100 | testEscapePath(t, json, "test.\\*v", "val0") |
| 101 | testEscapePath(t, json, "test.keyv\\*", "val1") |
| 102 | testEscapePath(t, json, "test.key\\*v", "val2") |
| 103 | testEscapePath(t, json, "test.keyv\\?", "val3") |
| 104 | testEscapePath(t, json, "test.key\\?v", "val4") |
| 105 | testEscapePath(t, json, "test.keyv\\.", "val5") |
| 106 | testEscapePath(t, json, "test.key\\.v", "val6") |
| 107 | testEscapePath(t, json, "test.keyk\\*.key\\?", "val7") |
| 108 | } |
| 109 | |
| 110 | // this json block is poorly formed on purpose. |
| 111 | var basicJSON = ` {"age":100, "name":{"here":"B\\\"R"}, |
nothing calls this directly
no test coverage detected
searching dependent graphs…