~emersion/mrsh

5d3849dd251a5a7ebf23564975dfdba9f4502a64 — Simon Ser 1 year, 2 months ago 56b4bce
test: add pipeline

The two last tests are disabled because they don't pass.
2 files changed, 27 insertions(+), 0 deletions(-)

M test/meson.build
A test/pipeline.sh
M test/meson.build => test/meson.build +1 -0
@@ 8,6 8,7 @@ test_files = [
	'for.sh',
	'function.sh',
	'loop.sh',
	'pipeline.sh',
	'subshell.sh',
	'ulimit.sh',
	'word.sh',

A test/pipeline.sh => test/pipeline.sh +26 -0
@@ 0,0 1,26 @@
#!/bin/sh

echo >&2 "Pipeline with 1 command"
echo "a b c d"

echo >&2 "Pipeline with 2 commands"
echo "a b c d" | sed s/b/B/

echo >&2 "Pipeline with 3 commands"
echo "a b c d" | sed s/b/B/ | sed s/c/C/

echo >&2 "Pipeline with subshell"
(echo "a b"; echo "c d") | sed s/c/C/

#echo >&2 "Pipeline with brace group"
#{ echo "a b"; echo "c d"; } | sed s/c/C/

#echo >&2 "Pipeline with early close"
#(
#	i=0
#	while [ $i -lt 8096 ]
#	do
#		echo "Line $i"
#		i=$((i+1))
#	done
#) | head -n 1