summaryrefslogtreecommitdiffstats
path: root/tests/test_sqlcompletion.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_sqlcompletion.py')
-rw-r--r--tests/test_sqlcompletion.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_sqlcompletion.py b/tests/test_sqlcompletion.py
index 949321e7..df0cdc7c 100644
--- a/tests/test_sqlcompletion.py
+++ b/tests/test_sqlcompletion.py
@@ -127,3 +127,17 @@ def test_on_suggests_tables():
'select abc.x, bcd.y from abc join bcd on ')
assert category == 'tables-or-aliases'
assert set(scope) == set(['abc', 'bcd'])
+
+def test_on_suggests_aliases_right_side():
+ category, scope = suggest_type(
+ 'select a.x, b.y from abc a join bcd b on a.id = ',
+ 'select a.x, b.y from abc a join bcd b on a.id = ')
+ assert category == 'tables-or-aliases'
+ assert set(scope) == set(['a', 'b'])
+
+def test_on_suggests_tables_right_side():
+ category, scope = suggest_type(
+ 'select abc.x, bcd.y from abc join bcd on ',
+ 'select abc.x, bcd.y from abc join bcd on ')
+ assert category == 'tables-or-aliases'
+ assert set(scope) == set(['abc', 'bcd'])