diff --git a/tests/queries/0_stateless/01610_client_spawn_editor.reference b/tests/queries/0_stateless/01610_client_spawn_editor.reference new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/queries/0_stateless/01610_client_spawn_editor.sh b/tests/queries/0_stateless/01610_client_spawn_editor.sh new file mode 100755 index 00000000000..d4eef77de64 --- /dev/null +++ b/tests/queries/0_stateless/01610_client_spawn_editor.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +#\ +export CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +#\ +. "$CURDIR"/../shell_config.sh +#\ +export EDITOR=$CURDIR/01610_client_spawn_editor_open.editor +#\ +exec expect -f $CURDIR/01610_client_spawn_editor.sh "$@" + +log_user 0 +set timeout 1 + +spawn clickhouse-client +expect ":) " + +# Open EDITOR +send -- "\033E" +# Send return +send -- "\r" +expect { + "│ 1 │" { } + timeout { exit 1 } +} +expect ":) " + +send -- "" +expect eof diff --git a/tests/queries/0_stateless/01610_client_spawn_editor_open.editor b/tests/queries/0_stateless/01610_client_spawn_editor_open.editor new file mode 100755 index 00000000000..4f80871f5f9 --- /dev/null +++ b/tests/queries/0_stateless/01610_client_spawn_editor_open.editor @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +echo "select 1" > "$1"