File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
core/src/test/kotlin/org/evomaster/core/output/formatter Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -151,5 +151,19 @@ class OutputFormatterTest {
151151 assertFalse(isValid)
152152 }
153153
154+ @Test
155+ fun testInvalidJsonWithAsciiControlCharacter () {
156+ val json = " {\" s0\" :\" This is a long string\" , \" s1\" :\" This isa long string\" , \" s2\" :\" _EM_3149_XYZ_\" } "
157+ val isValid = OutputFormatter .JSON_FORMATTER .isValid(json)
158+ assertFalse(isValid)
159+ }
160+
161+ @Test
162+ fun testValidJsonWithEscapedAsciiControlCharacter () {
163+ val json = " {\" s0\" :\" This is a long string\" , \" s1\" :\" This is\\ u001Fa long string\" , \" s2\" :\" _EM_3149_XYZ_\" } "
164+ val isValid = OutputFormatter .JSON_FORMATTER .isValid(json)
165+ assertTrue(isValid)
166+ }
167+
154168
155169}
You can’t perform that action at this time.
0 commit comments