()
| 70 | |
| 71 | |
| 72 | def 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 | |
| 82 | def test_cte_extraction_around_comments(): |
nothing calls this directly
no test coverage detected