From 650c2aa3aeee390e9db0abbadf85b87f1ac079a1 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 7 Jun 2022 12:54:12 +1000 Subject: [PATCH] Add tests for prompt history behaviour --- test/prompt/history-abort-previous/cmd | 1 + test/prompt/history-abort-previous/out | 1 + test/prompt/history-abort-previous/rc | 1 + test/prompt/history-abort-previous/script | 2 ++ test/prompt/history-navigate/cmd | 1 + test/prompt/history-navigate/out | 1 + test/prompt/history-navigate/rc | 1 + test/prompt/history-navigate/script | 2 ++ test/prompt/history-previous-prefix/cmd | 1 + test/prompt/history-previous-prefix/out | 1 + test/prompt/history-previous-prefix/rc | 1 + test/prompt/history-previous-prefix/script | 2 ++ test/prompt/history-previous/cmd | 1 + test/prompt/history-previous/out | 1 + test/prompt/history-previous/rc | 1 + test/prompt/history-previous/script | 2 ++ test/prompt/history-repeat-last/cmd | 1 + test/prompt/history-repeat-last/out | 1 + test/prompt/history-repeat-last/rc | 1 + test/prompt/history-repeat-last/script | 2 ++ test/prompt/history-stop-at-first/cmd | 1 + test/prompt/history-stop-at-first/out | 1 + test/prompt/history-stop-at-first/rc | 1 + test/prompt/history-stop-at-first/script | 2 ++ 24 files changed, 30 insertions(+) create mode 100644 test/prompt/history-abort-previous/cmd create mode 100644 test/prompt/history-abort-previous/out create mode 100644 test/prompt/history-abort-previous/rc create mode 100644 test/prompt/history-abort-previous/script create mode 100644 test/prompt/history-navigate/cmd create mode 100644 test/prompt/history-navigate/out create mode 100644 test/prompt/history-navigate/rc create mode 100644 test/prompt/history-navigate/script create mode 100644 test/prompt/history-previous-prefix/cmd create mode 100644 test/prompt/history-previous-prefix/out create mode 100644 test/prompt/history-previous-prefix/rc create mode 100644 test/prompt/history-previous-prefix/script create mode 100644 test/prompt/history-previous/cmd create mode 100644 test/prompt/history-previous/out create mode 100644 test/prompt/history-previous/rc create mode 100644 test/prompt/history-previous/script create mode 100644 test/prompt/history-repeat-last/cmd create mode 100644 test/prompt/history-repeat-last/out create mode 100644 test/prompt/history-repeat-last/rc create mode 100644 test/prompt/history-repeat-last/script create mode 100644 test/prompt/history-stop-at-first/cmd create mode 100644 test/prompt/history-stop-at-first/out create mode 100644 test/prompt/history-stop-at-first/rc create mode 100644 test/prompt/history-stop-at-first/script diff --git a/test/prompt/history-abort-previous/cmd b/test/prompt/history-abort-previous/cmd new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/prompt/history-abort-previous/cmd @@ -0,0 +1 @@ + diff --git a/test/prompt/history-abort-previous/out b/test/prompt/history-abort-previous/out new file mode 100644 index 00000000..84526774 --- /dev/null +++ b/test/prompt/history-abort-previous/out @@ -0,0 +1 @@ +bazbarfoob diff --git a/test/prompt/history-abort-previous/rc b/test/prompt/history-abort-previous/rc new file mode 100644 index 00000000..90e623cd --- /dev/null +++ b/test/prompt/history-abort-previous/rc @@ -0,0 +1 @@ +define-command append -params 1 %{ set-register dquote %arg{1}; execute-keys A" } diff --git a/test/prompt/history-abort-previous/script b/test/prompt/history-abort-previous/script new file mode 100644 index 00000000..b9af7037 --- /dev/null +++ b/test/prompt/history-abort-previous/script @@ -0,0 +1,2 @@ +ui_out -ignore 4 +ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ ":append baz:append bar:append foo:append b" ] }' diff --git a/test/prompt/history-navigate/cmd b/test/prompt/history-navigate/cmd new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/prompt/history-navigate/cmd @@ -0,0 +1 @@ + diff --git a/test/prompt/history-navigate/out b/test/prompt/history-navigate/out new file mode 100644 index 00000000..17a83b6d --- /dev/null +++ b/test/prompt/history-navigate/out @@ -0,0 +1 @@ +foobarbazbar diff --git a/test/prompt/history-navigate/rc b/test/prompt/history-navigate/rc new file mode 100644 index 00000000..90e623cd --- /dev/null +++ b/test/prompt/history-navigate/rc @@ -0,0 +1 @@ +define-command append -params 1 %{ set-register dquote %arg{1}; execute-keys A" } diff --git a/test/prompt/history-navigate/script b/test/prompt/history-navigate/script new file mode 100644 index 00000000..eb8c8cf8 --- /dev/null +++ b/test/prompt/history-navigate/script @@ -0,0 +1,2 @@ +ui_out -ignore 4 +ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ ":append foo:append bar:append baz:" ] }' diff --git a/test/prompt/history-previous-prefix/cmd b/test/prompt/history-previous-prefix/cmd new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/prompt/history-previous-prefix/cmd @@ -0,0 +1 @@ + diff --git a/test/prompt/history-previous-prefix/out b/test/prompt/history-previous-prefix/out new file mode 100644 index 00000000..72043b59 --- /dev/null +++ b/test/prompt/history-previous-prefix/out @@ -0,0 +1 @@ +bazbarfoobar diff --git a/test/prompt/history-previous-prefix/rc b/test/prompt/history-previous-prefix/rc new file mode 100644 index 00000000..90e623cd --- /dev/null +++ b/test/prompt/history-previous-prefix/rc @@ -0,0 +1 @@ +define-command append -params 1 %{ set-register dquote %arg{1}; execute-keys A" } diff --git a/test/prompt/history-previous-prefix/script b/test/prompt/history-previous-prefix/script new file mode 100644 index 00000000..6e7d4b01 --- /dev/null +++ b/test/prompt/history-previous-prefix/script @@ -0,0 +1,2 @@ +ui_out -ignore 4 +ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ ":append baz:append bar:append foo:append b" ] }' diff --git a/test/prompt/history-previous/cmd b/test/prompt/history-previous/cmd new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/prompt/history-previous/cmd @@ -0,0 +1 @@ + diff --git a/test/prompt/history-previous/out b/test/prompt/history-previous/out new file mode 100644 index 00000000..17a83b6d --- /dev/null +++ b/test/prompt/history-previous/out @@ -0,0 +1 @@ +foobarbazbar diff --git a/test/prompt/history-previous/rc b/test/prompt/history-previous/rc new file mode 100644 index 00000000..90e623cd --- /dev/null +++ b/test/prompt/history-previous/rc @@ -0,0 +1 @@ +define-command append -params 1 %{ set-register dquote %arg{1}; execute-keys A" } diff --git a/test/prompt/history-previous/script b/test/prompt/history-previous/script new file mode 100644 index 00000000..de55fc35 --- /dev/null +++ b/test/prompt/history-previous/script @@ -0,0 +1,2 @@ +ui_out -ignore 4 +ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ ":append foo:append bar:append baz:" ] }' diff --git a/test/prompt/history-repeat-last/cmd b/test/prompt/history-repeat-last/cmd new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/prompt/history-repeat-last/cmd @@ -0,0 +1 @@ + diff --git a/test/prompt/history-repeat-last/out b/test/prompt/history-repeat-last/out new file mode 100644 index 00000000..55b5f1fc --- /dev/null +++ b/test/prompt/history-repeat-last/out @@ -0,0 +1 @@ +foofoo diff --git a/test/prompt/history-repeat-last/rc b/test/prompt/history-repeat-last/rc new file mode 100644 index 00000000..6000dff4 --- /dev/null +++ b/test/prompt/history-repeat-last/rc @@ -0,0 +1 @@ +define-command test %{ execute-keys Afoo } diff --git a/test/prompt/history-repeat-last/script b/test/prompt/history-repeat-last/script new file mode 100644 index 00000000..7e744832 --- /dev/null +++ b/test/prompt/history-repeat-last/script @@ -0,0 +1,2 @@ +ui_out -ignore 4 +ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ ":test:" ] }' diff --git a/test/prompt/history-stop-at-first/cmd b/test/prompt/history-stop-at-first/cmd new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/prompt/history-stop-at-first/cmd @@ -0,0 +1 @@ + diff --git a/test/prompt/history-stop-at-first/out b/test/prompt/history-stop-at-first/out new file mode 100644 index 00000000..7a594c45 --- /dev/null +++ b/test/prompt/history-stop-at-first/out @@ -0,0 +1 @@ +foobarfoo diff --git a/test/prompt/history-stop-at-first/rc b/test/prompt/history-stop-at-first/rc new file mode 100644 index 00000000..90e623cd --- /dev/null +++ b/test/prompt/history-stop-at-first/rc @@ -0,0 +1 @@ +define-command append -params 1 %{ set-register dquote %arg{1}; execute-keys A" } diff --git a/test/prompt/history-stop-at-first/script b/test/prompt/history-stop-at-first/script new file mode 100644 index 00000000..296ca640 --- /dev/null +++ b/test/prompt/history-stop-at-first/script @@ -0,0 +1,2 @@ +ui_out -ignore 4 +ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ ":append foo:append bar:" ] }'