Skip to content

Commit

Permalink
Cleanup remove-pg_catalog-from-functions test code
Browse files Browse the repository at this point in the history
No functional change
  • Loading branch information
borisz committed Sep 14, 2021
1 parent e9a020b commit 881854a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,14 @@ def test_cli_workhorse():
" , count(*)\n"
"FROM t1\n")

with StringIO("select substring('123',2,3), regexp_split_to_array('x,x,x', ','), btrim('xxx'), trim('xxx'), POSITION('hour' in trim(substring('xyz hour ',1,6)))") as input:
in_stmt = """\
select substring('123',2,3),
regexp_split_to_array('x,x,x', ','),
btrim('xxx'), trim('xxx'),
POSITION('hour' in trim(substring('xyz hour ',1,6)))
"""

with StringIO(in_stmt) as input:
with UnclosableStream() as output:
with redirect_stdin(input), redirect_stdout(output):
main(['--compact-lists-margin', '100'])
Expand All @@ -138,7 +145,7 @@ def test_cli_workhorse():
, pg_catalog.position(pg_catalog.btrim(pg_catalog.substring('xyz hour ', 1, 6)), 'hour')
"""

with StringIO("select substring('123',2,3), regexp_split_to_array('x,x,x', ','), btrim('xxx'), trim('xxx'), POSITION('hour' in trim(substring('xyz hour ',1,6)))") as input:
with StringIO(in_stmt) as input:
with UnclosableStream() as output:
with redirect_stdin(input), redirect_stdout(output):
main(['--remove-pg_catalog-from-functions', '--compact-lists-margin', '100'])
Expand All @@ -149,5 +156,3 @@ def test_cli_workhorse():
, btrim('xxx')
, pg_catalog.position(btrim(substring('xyz hour ', 1, 6)), 'hour')
"""


0 comments on commit 881854a

Please sign in to comment.