MCPcopy Index your code
hub / github.com/marimo-team/marimo / test_edge_cases

Method test_edge_cases

tests/_ast/test_sql_utils.py:209–233  ·  view source on GitHub ↗

Test edge cases and unusual inputs.

(self)

Source from the content-addressed store, hash-verified

207 assert classify_sql_statement(complex_dql) == "DQL"
208
209 def test_edge_cases(self):
210 """Test edge cases and unusual inputs."""
211 # Empty string
212 assert classify_sql_statement("") == "unknown"
213
214 # Whitespace only
215 assert classify_sql_statement(" ") == "unknown"
216
217 # Invalid SQL
218 assert classify_sql_statement("INVALID SQL STATEMENT") == "unknown"
219 assert (
220 classify_sql_statement("SELECT * FROM") == "unknown"
221 ) # Incomplete statement
222
223 # SQL with comments
224 assert (
225 classify_sql_statement("-- This is a comment\nSELECT * FROM users")
226 == "DQL"
227 )
228 assert (
229 classify_sql_statement(
230 "/* Multi-line comment */\nCREATE TABLE users (id INT)"
231 )
232 == "DDL"
233 )
234
235 def test_multiple_statements(self):
236 """Test that the function handles the first statement in a batch."""

Callers

nothing calls this directly

Calls 1

classify_sql_statementFunction · 0.90

Tested by

no test coverage detected