()
| 75 | |
| 76 | |
| 77 | def 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 | |
| 87 | def test_cte_extraction_around_comments(): |
nothing calls this directly
no test coverage detected