~emersion/mrsh

ref: ec97ac337f6321197c3809759b75eeda97e1bdc9 mrsh/test/harness.sh -rwxr-xr-x 461 bytes
ec97ac33Simon Ser shell/task/word: implement trim prefix/suffix operator for simple patterns 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
dir=$(dirname "$0")
testcase="$1"

echo "Running with mrsh"
mrsh_out=$("$MRSH" "$testcase")
mrsh_ret=$?
echo "Running with reference shell ($REF_SH)"
ref_out=$("$REF_SH" "$testcase")
ref_ret=$?
if [ $mrsh_ret -ne $ref_ret ] || [ "$mrsh_out" != "$ref_out" ]
then
	echo >&2 "$testcase: mismatch"
	echo >&2 ""
	echo >&2 "mrsh: $mrsh_ret"
	echo >&2 "$mrsh_out"
	echo >&2 ""
	echo >&2 "ref ($REF_SH): $ref_ret"
	echo >&2 "$ref_out"
	echo >&2 ""
	exit 1
fi