MCPcopy Create free account
hub / github.com/dbcli/mssql-cli / test_simple_cte_extraction

Function test_simple_cte_extraction

tests/parseutils/test_ctes.py:72–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70
71
72def test_simple_cte_extraction():
73 sql = 'WITH a AS (SELECT abc FROM xxx) SELECT * FROM a'
74 start_pos = len('WITH a AS ')
75 stop_pos = len('WITH a AS (SELECT abc FROM xxx)')
76 ctes, remainder = extract_ctes(sql)
77
78 assert tuple(ctes) == (('a', ('abc',), start_pos, stop_pos),)
79 assert remainder.strip() == 'SELECT * FROM a'
80
81
82def test_cte_extraction_around_comments():

Callers

nothing calls this directly

Calls 1

extract_ctesFunction · 0.90

Tested by

no test coverage detected