Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Internal
--------
* Replace `pyfzf` dependency with internal implementation.
* Use the `uv` outside of the `tox` environment when testing.
* Use forward-slash forms of special commands in the behave test suite.


v2.27.0 (2026/09/29)
Expand Down
4 changes: 2 additions & 2 deletions test/features/basic_commands.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Feature: run the cli,
insert the date,
exit the cli

Scenario: run "\?" command
When we send "\?" command
Scenario: run "/help" command
When we send "/help" command
then we see help output

Scenario: run source command
Expand Down
6 changes: 3 additions & 3 deletions test/features/iocommands.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ Feature: I/O commands
and delimiter is set to "%"

Scenario: send output to file
When we query "\o /tmp/output1.sql"
When we query "/once /tmp/output1.sql"
and we query "select 123"
and we query "system cat /tmp/output1.sql"
then we see csv result "123"

Scenario: send output to file two times
When we query "\o /tmp/output1.sql"
When we query "/once /tmp/output1.sql"
and we query "select 123"
and we query "\o /tmp/output2.sql"
and we query "/once /tmp/output2.sql"
and we query "select 456"
and we query "system cat /tmp/output2.sql"
then we see csv result "456"
Expand Down
8 changes: 4 additions & 4 deletions test/features/steps/basic_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ def step_ctrl_o_ctrl_d(context):
context.cli.sendline("")


@when(r'we send "\?" command')
@when('we send "/help" command')
def step_send_help(context):
r"""Send \?
"""Send /help

to see help.

"""
context.cli.sendline("\\?")
context.cli.sendline("/help")
wrappers.expect_exact(context, context.conf["pager_boundary"] + "\r\n", timeout=5)


Expand All @@ -60,7 +60,7 @@ def step_send_source_command(context):
with tempfile.NamedTemporaryFile(prefix=TEMPFILE_PREFIX) as f:
f.write(b"SELECT 1")
f.flush()
context.cli.sendline(f"\\. {f.name}")
context.cli.sendline(f"/source {f.name}")
wrappers.expect_exact(context, context.conf["pager_boundary"] + "\r\n", timeout=5)


Expand Down
2 changes: 1 addition & 1 deletion test/features/steps/iocommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def step_edit_file(context):
context.editor_file_name = os.path.join(context.package_root, f"test_file_{context.conf['vi']}.sql")
if os.path.exists(context.editor_file_name):
os.remove(context.editor_file_name)
context.cli.sendline(f"\\e {os.path.basename(context.editor_file_name)}")
context.cli.sendline(f"/edit {os.path.basename(context.editor_file_name)}")
wrappers.expect_exact(context, 'Entering Ex mode. Type "visual" to go to Normal mode.', timeout=4)
wrappers.expect_exact(context, "\r\n:", timeout=4)

Expand Down
34 changes: 17 additions & 17 deletions test/features/steps/named_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@

@when("we save a named query")
def step_save_named_query(context):
"""Send \fs command."""
context.cli.sendline("\\fs foo SELECT 12345")
"""Send '/favorite save' command."""
context.cli.sendline("/favorite save foo SELECT 12345")


@when("we use a named query")
def step_use_named_query(context):
"""Send \f command."""
context.cli.sendline("\\f foo")
"""Send '/favorite run' command."""
context.cli.sendline("/favorite run foo")


@when("we delete a named query")
def step_delete_named_query(context):
"""Send \fd command."""
context.cli.sendline("\\fd foo")
"""Send '/favorite delete' command."""
context.cli.sendline("/favorite delete foo")


@then("we see the named query saved")
Expand All @@ -49,14 +49,14 @@ def step_see_named_query_deleted(context):

@when("we save a named query with parameters")
def step_save_named_query_with_parameters(context):
"""Send \fs command for query with parameters."""
context.cli.sendline('\\fs foo_args SELECT $1, "$2", "$3"')
"""Send '/favorite save' command for query with parameters."""
context.cli.sendline('/favorite save foo_args SELECT $1, "$2", "$3"')


@when("we use named query with parameters")
def step_use_named_query_with_parameters(context):
"""Send \f command with parameters."""
context.cli.sendline('\\f foo_args 101 second "third value"')
"""Send '/favorite run' command with parameters."""
context.cli.sendline('/favorite run foo_args 101 second "third value"')


@then("we see the named query with parameters executed")
Expand All @@ -67,8 +67,8 @@ def step_see_named_query_with_parameters_executed(context):

@when("we use named query with too few parameters")
def step_use_named_query_with_too_few_parameters(context):
"""Send \f command with missing parameters."""
context.cli.sendline("\\f foo_args 101")
"""Send '/favorite run' command with missing parameters."""
context.cli.sendline("/favorite run foo_args 101")


@then("we see the named query with parameters fail with missing parameters")
Expand All @@ -79,8 +79,8 @@ def step_see_named_query_with_parameters_fail_with_missing_parameters(context):

@when("we use named query with too many parameters")
def step_use_named_query_with_too_many_parameters(context):
"""Send \f command with extra parameters."""
context.cli.sendline("\\f foo_args 101 102 103 104")
"""Send '/favorite run' command with extra parameters."""
context.cli.sendline("/favorite run foo_args 101 102 103 104")


@then("we see the named query with parameters fail with extra parameters")
Expand All @@ -91,12 +91,12 @@ def step_see_named_query_with_parameters_fail_with_extra_parameters(context):

@when("we save a templated named query")
def step_save_templated_named_query(context):
context.cli.sendline("\\fs template SELECT '{{ kv.user }}', '$1'")
context.cli.sendline("/favorite save template SELECT '{{ kv.user }}', '$1'")


@when("we use a templated named query with attached values")
def step_use_templated_named_query_with_attached_values(context):
context.cli.sendline("\\f template positional --user=henry")
context.cli.sendline("/favorite run template positional --user=henry")


@then("we see the attached template values rendered")
Expand All @@ -106,7 +106,7 @@ def step_see_attached_template_values_rendered(context):

@when("we use a templated named query with split values")
def step_use_templated_named_query_with_split_values(context):
context.cli.sendline('\\f template second --user "Henry Ford"')
context.cli.sendline('/favorite run template second --user "Henry Ford"')


@then("we see the split template values rendered")
Expand Down
Loading