summaryrefslogtreecommitdiffstats
path: root/tests/test_smart_completion_public_schema_only.py
diff options
context:
space:
mode:
authorAnthony Lai <anthony@mixbook.com>2016-03-18 17:47:21 -0700
committerAnthony Lai <anthony@mixbook.com>2016-03-18 21:27:07 -0700
commit1fe6ff06a268b9039cd67b571bddf5a7044414e3 (patch)
treee3c383d3c00431e841c0a70e9c90f1df6da04b96 /tests/test_smart_completion_public_schema_only.py
parentc3a7284bc8bbd58b68dd885b5339d8c29685bd6d (diff)
Fix lexical order tiebreaking
Diffstat (limited to 'tests/test_smart_completion_public_schema_only.py')
-rw-r--r--tests/test_smart_completion_public_schema_only.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/test_smart_completion_public_schema_only.py b/tests/test_smart_completion_public_schema_only.py
index 9b400ebd..fce9b9e7 100644
--- a/tests/test_smart_completion_public_schema_only.py
+++ b/tests/test_smart_completion_public_schema_only.py
@@ -379,6 +379,14 @@ def test_table_names_after_from(completer, complete_event):
Completion(text='set_returning_func', start_position=0, display_meta='function')
])
+def test_table_names_after_from_are_lexical_ordered_by_text(completer, complete_event):
+ text = 'SELECT * FROM '
+ position = len('SELECT * FROM ')
+ result = completer.get_completions(
+ Document(text=text, cursor_position=position),
+ complete_event)
+ assert result == sorted(result, key=lambda c: c.text)
+
def test_auto_escaped_col_names(completer, complete_event):
text = 'SELECT from "select"'
position = len('SELECT ')
@@ -498,8 +506,8 @@ def test_join_functions_on_suggests_columns(completer, complete_event):
assert set(result) == set([
Completion(text='x', start_position=0, display_meta='column'),
Completion(text='y', start_position=0, display_meta='column')])
-
-
+
+
def test_learn_keywords(completer, complete_event):
sql = 'CREATE VIEW v AS SELECT 1'
completer.extend_query_history(sql)