sedulam commented on code in PR #3812:
URL: https://github.com/apache/cassandra/pull/3812#discussion_r1943268581


##########
pylib/cqlshlib/test/test_cql_parsing.py:
##########
@@ -804,6 +804,39 @@ def test_strip_comment_blocks_from_input(self):
                                ''')
         self.assertRaises(SyntaxError)
 
+    def test_group_tokens_skip_duplicate_endtokens(self):
+        tokens = [
+            ('reserved_identifier', 'SELECT', (0, 6)),
+            ('star', '*', (7, 8)),
+            ('endtoken', ';', (9, 10)),  # first semicolon
+            ('endtoken', ';', (11, 12)),  # duplicate semicolon to skip
+            ('reserved_identifier', 'FROM', (13, 17)),
+            ('identifier', 'my_table', (18, 26)),
+            ('endtoken', ';', (27, 28)),  # valid semicolon to keep
+            ('reserved_identifier', 'SELECT', (29, 35)),
+            ('identifier', 'another_table', (36, 51)),
+            ('endtoken', ';', (52, 53))  # valid semicolon to keep
+        ]

Review Comment:
   Made it valid CQL, but noticed that the test_cql_parsing.py do not test for 
syntax, ie, something like `SELECT PRIMARY ks.tab;` gets accepted anyway, 
probably by intent. Also noticed that the current test framework doesn't test 
for multi batch on cqlhandling, so just used a single statement. 



-- 
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: pr-unsubscr...@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to