summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDaniel Rocco <drocco@gmail.com>2015-04-11 09:49:21 -0400
committerDaniel Rocco <drocco@gmail.com>2015-04-11 09:55:34 -0400
commite85116d846e17a1a4eb6d0ef22d74573edc8a92d (patch)
tree28defacdc2f27cdba8b68111d0ab9a46980cd394 /tests
parent659ea22f379b69e1da34f89aae40ef1885dc020c (diff)
Handle a ',' entered before any completions gracefully
Fixes #197
Diffstat (limited to 'tests')
-rw-r--r--tests/test_sqlcompletion.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/test_sqlcompletion.py b/tests/test_sqlcompletion.py
index 5bd12daf..cae041fe 100644
--- a/tests/test_sqlcompletion.py
+++ b/tests/test_sqlcompletion.py
@@ -278,4 +278,11 @@ def test_specials_not_included_after_initial_token():
def test_drop_schema_qualified_table_suggests_only_tables():
text = 'DROP TABLE schema_name.table_name'
suggestions = suggest_type(text, text)
- assert suggestions == [{'type': 'table', 'schema': 'schema_name'}] \ No newline at end of file
+ assert suggestions == [{'type': 'table', 'schema': 'schema_name'}]
+
+
+@pytest.mark.parametrize('text', [',', ' ,', 'sel ,'])
+def test_handle_pre_completion_comma_gracefully(text):
+ suggestions = suggest_type(text, text)
+
+ assert iter(suggestions)