MCPcopy Index your code
hub / github.com/dbcli/pgcli / test_simple_cte_extraction

Function test_simple_cte_extraction

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

Source from the content-addressed store, hash-verified

75
76
77def test_simple_cte_extraction():
78 sql = "WITH a AS (SELECT abc FROM xxx) SELECT * FROM a"
79 start_pos = len("WITH a AS ")
80 stop_pos = len("WITH a AS (SELECT abc FROM xxx)")
81 ctes, remainder = extract_ctes(sql)
82
83 assert tuple(ctes) == (("a", ("abc",), start_pos, stop_pos),)
84 assert remainder.strip() == "SELECT * FROM a"
85
86
87def test_cte_extraction_around_comments():

Callers

nothing calls this directly

Calls 1

extract_ctesFunction · 0.90

Tested by

no test coverage detected