diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_regressions.py | 7 | ||||
| -rw-r--r-- | tests/test_tokenize.py | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_regressions.py b/tests/test_regressions.py index 73bc504..1d52ea7 100644 --- a/tests/test_regressions.py +++ b/tests/test_regressions.py @@ -366,3 +366,10 @@ def test_issue322_concurrently_is_keyword(): def test_issue359_index_error_assignments(s): sqlparse.parse(s) sqlparse.format(s, strip_comments=True) + + +def test_issue469_copy_as_psql_command(): + formatted = sqlparse.format( + '\\copy select * from foo', + keyword_case='upper', identifier_case='capitalize') + assert formatted == '\\copy SELECT * FROM Foo' diff --git a/tests/test_tokenize.py b/tests/test_tokenize.py index 23a5157..fcd1102 100644 --- a/tests/test_tokenize.py +++ b/tests/test_tokenize.py @@ -195,3 +195,9 @@ def test_parse_order_by(): p = sqlparse.parse('ORDER BY')[0] assert len(p.tokens) == 1 assert p.tokens[0].ttype is T.Keyword + + +def test_cli_commands(): + p = sqlparse.parse('\\copy')[0] + assert len(p.tokens) == 1 + assert p.tokens[0].ttype == T.Command |
