MCPcopy Create free account
hub / github.com/apache/tomcat / testEscaping

Method testEscaping

test/org/apache/juli/TestJsonFormatter.java:58–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56 }
57
58 @Test
59 public void testEscaping() {
60 String[][] tests = new String[][] {
61 new String[] { "x", "x" }, // Don't escape
62 new String[] { "/", "/" }, // Don't escape
63 new String[] { "\\", "\\\\" },
64 new String[] { "\"", "\\\"" },
65 new String[] { "\n", "\\n" },
66 new String[] { "\r", "\\r" },
67 new String[] { "\u000B", "\\u000b" }
68 };
69
70 for (String[] test : tests) {
71 CharSequence result = JsonFormatter.JSONFilter.escape(test[0]);
72
73 Assert.assertEquals(test[1], String.valueOf(result));
74 }
75 }
76}

Callers

nothing calls this directly

Calls 2

escapeMethod · 0.45
valueOfMethod · 0.45

Tested by

no test coverage detected