From a9725ddb4a351df205177a76dbc9de501ce4ad19 Mon Sep 17 00:00:00 2001 From: wishfort36 <42300264+wishfort36@users.noreply.github.com> Date: Sun, 12 Aug 2018 22:31:12 +0200 Subject: [PATCH] Add tests for $QUTE_COUNT --- tests/end2end/data/userscripts/hello_if_count | 11 +++++++++++ tests/end2end/features/spawn.feature | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100755 tests/end2end/data/userscripts/hello_if_count diff --git a/tests/end2end/data/userscripts/hello_if_count b/tests/end2end/data/userscripts/hello_if_count new file mode 100755 index 000000000..7ba64a76e --- /dev/null +++ b/tests/end2end/data/userscripts/hello_if_count @@ -0,0 +1,11 @@ +#!/bin/bash + +if [ "$QUTE_COUNT" = "5" ]; then + + echo "message-info 'Count is five!'" >> "$QUTE_FIFO" + +elif [ "$QUTE_COUNT" = "None" ]; then + + echo "message-info 'No count!'" >> "$QUTE_FIFO" + +fi diff --git a/tests/end2end/features/spawn.feature b/tests/end2end/features/spawn.feature index 2a1ea0039..87ffb53e0 100644 --- a/tests/end2end/features/spawn.feature +++ b/tests/end2end/features/spawn.feature @@ -47,6 +47,17 @@ Feature: :spawn - data/hello.txt - data/hello.txt (active) + @posix + Scenario: Running :spawn with userscript and count + When I run :spawn -u (testdata)/userscripts/hello_if_count with count 5 + Then the message "Count is five!" should be shown + + @posix + Scenario: Running :spawn with userscript and no count + When I run :spawn -u (testdata)/userscripts/hello_if_count + Then the message "No count!" should be shown + + @windows Scenario: Running :spawn with userscript on Windows When I open data/hello.txt