summaryrefslogtreecommitdiffstats
path: root/tests/test_naive_completion.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_naive_completion.py')
-rw-r--r--tests/test_naive_completion.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/test_naive_completion.py b/tests/test_naive_completion.py
index 7c7ed8e7..a6c80a7c 100644
--- a/tests/test_naive_completion.py
+++ b/tests/test_naive_completion.py
@@ -53,6 +53,12 @@ def test_function_name_completion(completer, complete_event):
Completion(text="MATERIALIZED VIEW", start_position=-2),
Completion(text="MAX", start_position=-2),
Completion(text="MAXEXTENTS", start_position=-2),
+ Completion(text="MAKE_DATE", start_position=-2),
+ Completion(text="MAKE_TIME", start_position=-2),
+ Completion(text="MAKE_TIMESTAMPTZ", start_position=-2),
+ Completion(text="MAKE_INTERVAL", start_position=-2),
+ Completion(text="MASKLEN", start_position=-2),
+ Completion(text="MAKE_TIMESTAMP", start_position=-2),
]
)
@@ -101,3 +107,27 @@ def test_special_name_completion(completer, complete_event):
)
# Special commands will NOT be suggested during naive completion mode.
assert result == completions_to_set([])
+
+
+def test_datatype_name_completion(completer, complete_event):
+ text = "SELECT price::IN"
+ position = len("SELECT price::IN")
+ result = completions_to_set(
+ completer.get_completions(
+ Document(text=text, cursor_position=position),
+ complete_event,
+ smart_completion=True,
+ )
+ )
+ assert result == completions_to_set(
+ [
+ Completion(text="INET", display_meta="datatype"),
+ Completion(text="INT", display_meta="datatype"),
+ Completion(text="INT2", display_meta="datatype"),
+ Completion(text="INT4", display_meta="datatype"),
+ Completion(text="INT8", display_meta="datatype"),
+ Completion(text="INTEGER", display_meta="datatype"),
+ Completion(text="INTERNAL", display_meta="datatype"),
+ Completion(text="INTERVAL", display_meta="datatype"),
+ ]
+ )