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

Function test_cte_extraction_around_comments

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

Source from the content-addressed store, hash-verified

80
81
82def test_cte_extraction_around_comments():
83 sql = '''--blah blah blah
84 WITH a AS (SELECT abc def FROM x)
85 SELECT * FROM a'''
86 start_pos = len('''--blah blah blah
87 WITH a AS ''')
88 stop_pos = len('''--blah blah blah
89 WITH a AS (SELECT abc def FROM x)''')
90
91 ctes, remainder = extract_ctes(sql)
92 assert tuple(ctes) == (('a', ('def',), start_pos, stop_pos),)
93 assert remainder.strip() == 'SELECT * FROM a'
94
95
96def test_multiple_cte_extraction():

Callers

nothing calls this directly

Calls 1

extract_ctesFunction · 0.90

Tested by

no test coverage detected