()
| 80 | |
| 81 | |
| 82 | def 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 | |
| 96 | def test_multiple_cte_extraction(): |
nothing calls this directly
no test coverage detected