diff mbox

[RFA,3/4] Test the | (pipe) command.

Message ID 20190420212153.30934-4-philippe.waroquiers@skynet.be
State New
Headers show

Commit Message

Philippe Waroquiers April 20, 2019, 9:21 p.m. UTC
gdb/testsuite/ChangeLog
2019-04-20  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

	* gdb.base/shell.exp: Test pipe command.
---
 gdb/testsuite/gdb.base/shell.exp | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Tom Tromey April 24, 2019, 8:52 p.m. UTC | #1
>>>>> "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:

Philippe> gdb/testsuite/ChangeLog
Philippe> 2019-04-20  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

Philippe> 	* gdb.base/shell.exp: Test pipe command.

This seems fine though I wonder whether there are test environments
without the necessary commands.

Tom
diff mbox

Patch

diff --git a/gdb/testsuite/gdb.base/shell.exp b/gdb/testsuite/gdb.base/shell.exp
index 60d6e31e4f..1840eab322 100644
--- a/gdb/testsuite/gdb.base/shell.exp
+++ b/gdb/testsuite/gdb.base/shell.exp
@@ -22,3 +22,12 @@  gdb_test "shell echo foo" "foo"
 
 gdb_test "! echo foo" "foo"
 gdb_test "!echo foo" "foo"
+
+gdb_test "pipe help pipe | wc -l" "6" "check simple pipe"
+gdb_test "pipe help pipe | grep Usage: | wc -l" "2" "check double pipe"
+
+gdb_test "| help pipe | grep Usage: | wc -l" "2" "check double pipe, pipe char"
+gdb_test "|help pipe|grep Usage:|wc -l" "2" "no space around pipe char"
+
+gdb_test "echo coucou\\n" "coucou" "echo coucou"
+gdb_test "||wc -l" "1" "Check repeat previous command"