Prevent greedy matching in "we run" by using regular expression lookahead

This commit is contained in:
Micah Jerome Ellison 2023-02-20 12:22:22 -08:00
parent 7c16f3d094
commit 51f8ef54bb

View file

@ -30,7 +30,7 @@ all_input = '("(?P<all_input>[^"]*)")'
@when(parse('we run "jrnl {command}" and {input_method}\n{all_input}')) @when(parse('we run "jrnl {command}" and {input_method}\n{all_input}'))
@when(re(f'we run "jrnl ?{command}" and {input_method} {all_input}')) @when(re(f'we run "jrnl ?{command}" and {input_method} {all_input}'))
@when(parse('we run "jrnl {command}"')) @when(re(f'we run "jrnl {command}"(?! and)'))
@when('we run "jrnl"') @when('we run "jrnl"')
def we_run_jrnl(capsys, keyring, request, command, input_method, all_input): def we_run_jrnl(capsys, keyring, request, command, input_method, all_input):
from keyring import set_keyring from keyring import set_keyring