Merging upstream version 1.6.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
4b3dd727fd
commit
12edc19d72
17 changed files with 95 additions and 53 deletions
|
@ -54,6 +54,7 @@ wider_completion_menu = False
|
|||
# litecli prompt
|
||||
# \D - The full current date
|
||||
# \d - Database name
|
||||
# \f - File basename of the "main" database
|
||||
# \m - Minutes of the current time
|
||||
# \n - Newline
|
||||
# \P - AM/PM
|
||||
|
|
|
@ -36,7 +36,9 @@ def test_order_by_suggests_cols_with_qualified_table_scope():
|
|||
"SELECT * FROM sch.tabl ORDER BY ", "SELECT * FROM sch.tabl ORDER BY "
|
||||
)
|
||||
assert sorted_dicts(suggestions) == sorted_dicts(
|
||||
[{"type": "column", "tables": [("sch", "tabl", None)]},]
|
||||
[
|
||||
{"type": "column", "tables": [("sch", "tabl", None)]},
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -367,15 +367,17 @@ def test_auto_escaped_col_names(completer, complete_event):
|
|||
Document(text=text, cursor_position=position), complete_event
|
||||
)
|
||||
)
|
||||
assert result == [
|
||||
Completion(text="*", start_position=0),
|
||||
Completion(text="`ABC`", start_position=0),
|
||||
Completion(text="`insert`", start_position=0),
|
||||
Completion(text="id", start_position=0),
|
||||
] + list(map(Completion, completer.functions)) + [
|
||||
Completion(text="`select`", start_position=0)
|
||||
] + list(
|
||||
map(Completion, sorted(completer.keywords))
|
||||
assert (
|
||||
result
|
||||
== [
|
||||
Completion(text="*", start_position=0),
|
||||
Completion(text="`ABC`", start_position=0),
|
||||
Completion(text="`insert`", start_position=0),
|
||||
Completion(text="id", start_position=0),
|
||||
]
|
||||
+ list(map(Completion, completer.functions))
|
||||
+ [Completion(text="`select`", start_position=0)]
|
||||
+ list(map(Completion, sorted(completer.keywords)))
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -101,6 +101,17 @@ def test_unicode_support_in_output(executor):
|
|||
assert_result_equal(results, headers=["t"], rows=[(u"é",)])
|
||||
|
||||
|
||||
@dbtest
|
||||
def test_invalid_unicode_values_dont_choke(executor):
|
||||
run(executor, "create table unicodechars(t text)")
|
||||
# \xc3 is not a valid utf-8 char. But we can insert it into the database
|
||||
# which can break querying if not handled correctly.
|
||||
run(executor, u"insert into unicodechars (t) values (cast(x'c3' as text))")
|
||||
|
||||
results = run(executor, u"select * from unicodechars")
|
||||
assert_result_equal(results, headers=["t"], rows=[("\\xc3",)])
|
||||
|
||||
|
||||
@dbtest
|
||||
def test_multiple_queries_same_line(executor):
|
||||
results = run(executor, "select 'foo'; select 'bar'")
|
||||
|
@ -186,6 +197,7 @@ def test_bind_parameterized_favorite_query(executor):
|
|||
with pytest.raises(ProgrammingError):
|
||||
results = run(executor, "\\f+ q_param 1 2")
|
||||
|
||||
|
||||
@dbtest
|
||||
def test_verbose_feature_of_favorite_query(executor):
|
||||
set_expanded_output(False)
|
||||
|
@ -198,11 +210,7 @@ def test_verbose_feature_of_favorite_query(executor):
|
|||
|
||||
results = run(executor, "\\f sh_param 1")
|
||||
assert_result_equal(
|
||||
results,
|
||||
title=None,
|
||||
headers=["a", "id"],
|
||||
rows=[("abc", 1)],
|
||||
auto_status=False,
|
||||
results, title=None, headers=["a", "id"], rows=[("abc", 1)], auto_status=False,
|
||||
)
|
||||
|
||||
results = run(executor, "\\f+ sh_param 1")
|
||||
|
@ -214,6 +222,7 @@ def test_verbose_feature_of_favorite_query(executor):
|
|||
auto_status=False,
|
||||
)
|
||||
|
||||
|
||||
@dbtest
|
||||
def test_shell_parameterized_favorite_query(executor):
|
||||
set_expanded_output(False)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue