You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2023/12/13 21:45:10 UTC

(groovy) 02/02: GROOVY-11200: JsonSlurper should throw exception when parsing invalid String ended with a right curly brace

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 081873801a066492d9ea85944b3626635539e9ce
Author: yuhengfdada <87...@qq.com>
AuthorDate: Sun Oct 22 17:30:31 2023 +0800

    GROOVY-11200: JsonSlurper should throw exception when parsing invalid String ended with a right curly brace
---
 .../groovy-json/src/test/groovy/groovy/json/JsonSlurperTest.groovy | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/subprojects/groovy-json/src/test/groovy/groovy/json/JsonSlurperTest.groovy b/subprojects/groovy-json/src/test/groovy/groovy/json/JsonSlurperTest.groovy
index 758d2ced49..c67eb5a035 100644
--- a/subprojects/groovy-json/src/test/groovy/groovy/json/JsonSlurperTest.groovy
+++ b/subprojects/groovy-json/src/test/groovy/groovy/json/JsonSlurperTest.groovy
@@ -386,7 +386,12 @@ class JsonSlurperTest extends GroovyTestCase {
 
     void testParseStringEndedWithRightCurlyBrace() {
         def jsonSlurper = new JsonSlurper()
-        def inValid = """{"a":1,"b": {"c":2}"""
+        def inValid = """
+                            {
+                            "a":1,
+                            "b": {
+                                "c":2
+                            }"""
         shouldFail (JsonException) { jsonSlurper.parseText(inValid) }
 
         def valid = """