File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
grails-test-suite-web/src/test/groovy/org/codehaus/groovy/grails/web/converters Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,19 @@ class JSONConverterTests extends AbstractGrailsControllerTests {
129129
130130 assertEquals (' {"line":"first line \\ n second line"}' , result. toString())
131131 }
132+
133+ // GRAILS-11530
134+ void testMoreStringsWithQuotes () {
135+ def str = ' Hi, this is my "test"'
136+ def json = new grails.converters.JSON([a :str])
137+ assertEquals (' {"a":"Hi, this is my \\ "test\\ ""}' , json. toString())
138+
139+ }
140+
141+ // GRAILS-11517
142+ void testMoreStringsWithQuotes2 () {
143+ assertEquals (' {"key":"<a href=\\ "#\\ " class=\\ "link\\ ">link<\\ u002fa>"}' ,([' key' : ' <a href="#" class="link">link</a>' ] as JSON ). toString())
144+ }
132145
133146 void onSetUp () {
134147 GroovySystem . metaClassRegistry. removeMetaClass Errors
You can’t perform that action at this time.
0 commit comments