Closes 563: As never defined in RFC 6901 Section 3, do not handle backslashes (\) and quotes(") as anything special

This commit is contained in:
Shashank Sabniveesu
2021-02-28 16:01:59 -05:00
parent 7844eb79cd
commit d6ccc64c79
2 changed files with 23 additions and 13 deletions

View File

@@ -117,14 +117,24 @@ public class JSONPointerTest {
assertSame(document.get("m~n"), query("/m~0n"));
}
/**
* We pass backslashes as-is
*
* @see https://tools.ietf.org/html/rfc6901#section-3
*/
@Test
public void backslashEscaping() {
assertSame(document.get("i\\j"), query("/i\\\\j"));
public void backslashHandling() {
assertSame(document.get("i\\j"), query("/i\\j"));
}
/**
* We pass quotations as-is
*
* @see https://tools.ietf.org/html/rfc6901#section-3
*/
@Test
public void quotationEscaping() {
assertSame(document.get("k\"l"), query("/k\\\\\\\"l"));
public void quotationHandling() {
assertSame(document.get("k\"l"), query("/k\"l"));
}
@Test
@@ -189,7 +199,7 @@ public class JSONPointerTest {
.append("\"")
.append(0)
.build();
assertEquals("/obj/other~0key/another~1key/\\\"/0", pointer.toString());
assertEquals("/obj/other~0key/another~1key/\"/0", pointer.toString());
}
@Test