anupamaggarwal commented on code in PR #24967:
URL: https://github.com/apache/flink/pull/24967#discussion_r1671531397


##########
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/expressions/ScalarFunctionsTest.scala:
##########
@@ -604,6 +604,49 @@ class ScalarFunctionsTest extends ScalarTypesTestBase {
       "foothebar")
   }
 
+  @Test
+  def testJsonQuote(): Unit = {
+    testSqlApi("JSON_QUOTE('null')", "\"null\"")
+    testSqlApi("JSON_QUOTE('\"null\"')", "\"\\\"null\\\"\"")
+    testSqlApi("JSON_QUOTE('[1,2,3]')", "\"[1,2,3]\"")
+    testSqlApi("JSON_UNQUOTE(JSON_QUOTE('[1,2,3]'))", "[1,2,3]")
+    testSqlApi(
+      "JSON_QUOTE('This is a \\t test \\n with special characters: \" \\ \\b 
\\f \\r \\u0041')",
+      "\"This is a \\\\t test \\\\n with special characters: \\\" \\\\ \\\\b 
\\\\f \\\\r \\\\u0041\""
+    )
+    testSqlApi(
+      "JSON_QUOTE('\"special\": \"\\b\\f\\r\"')",
+      "\"\\\"special\\\": \\\"\\\\b\\\\f\\\\r\\\"\"")
+    testSqlApi(
+      "JSON_QUOTE('skipping backslash \')",
+      "\"skipping backslash \""
+    )
+    testSqlApi(
+      "JSON_QUOTE('this will be quoted ≠')",
+      "\"this will be quoted \\u2260\""
+    )
+  }
+
+  @Test
+  def testJsonUnquote(): Unit = {

Review Comment:
   thanks @fhueske for your review, will fix this



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to