From 26ea8dc36254f42efe7344d9f9e8e1505dc9905b Mon Sep 17 00:00:00 2001 From: slama Date: Wed, 7 Feb 2018 23:50:53 +0900 Subject: [PATCH] add tests for a pipe at the end of the line --- tests/generic.expect | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/generic.expect b/tests/generic.expect index 33d260a71..1b450f4ad 100644 --- a/tests/generic.expect +++ b/tests/generic.expect @@ -39,3 +39,20 @@ expect_prompt -re {echo .history.*} {} unmatched { send_line "echo -n #comment\\" expect_prompt +# a pipe at the end of the line (#1285) +send_line "echo hoge |\n cat" +expect_prompt "hoge" {} unmatched { + puts stderr "Error with a pipe at the end of the line" +} +send_line "echo hoge | \n cat" +expect_prompt "hoge" {} unmatched { + puts stderr "Error with a pipe at the end of the line with whitespaces" +} +send_line "echo hoge 2>| \n cat" +expect_prompt "hoge" {} unmatched { + puts stderr "Error with a pipe with redirection at the end of the line" +} +send_line "echo hoge >| \n cat" +expect_prompt "hoge" {} unmatched { + puts stderr "Error with a pipe with redirection at the end of the line" +}