From bdf5cc7bdd5ec93dc928d81e286f7b1e678ba19d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 13 Sep 2023 11:17:40 +0200 Subject: Merging upstream version 18.4.1. Signed-off-by: Daniel Baumann --- tests/test_parser.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/test_parser.py') diff --git a/tests/test_parser.py b/tests/test_parser.py index 7135dd8..ad9b941 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -719,3 +719,18 @@ class TestParser(unittest.TestCase): self.assertEqual(ast.find(exp.Interval).this.sql(), "'71'") self.assertEqual(ast.find(exp.Interval).unit.assert_is(exp.Var).sql(), "days") + + def test_parse_concat_ws(self): + ast = parse_one("CONCAT_WS(' ', 'John', 'Doe')") + + self.assertEqual(ast.sql(), "CONCAT_WS(' ', 'John', 'Doe')") + self.assertEqual(ast.expressions[0].sql(), "' '") + self.assertEqual(ast.expressions[1].sql(), "'John'") + self.assertEqual(ast.expressions[2].sql(), "'Doe'") + + # Ensure we can parse without argument when error level is ignore + ast = parse( + "CONCAT_WS()", + error_level=ErrorLevel.IGNORE, + ) + self.assertEqual(ast[0].sql(), "CONCAT_WS()") -- cgit v1.2.3