test: fix recur-010.sh
Use mktemp(1) to create temporary directory. Copy missing todo file. Do not modify any files in tests. Simplify and make some commands more robust. Indent continuation lines. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
parent
c1b3807cb0
commit
701f8e4fbd
@ -5,14 +5,21 @@
|
|||||||
. "${TEST_INIT:-./test-init.sh}"
|
. "${TEST_INIT:-./test-init.sh}"
|
||||||
|
|
||||||
if [ "$1" = 'actual' ]; then
|
if [ "$1" = 'actual' ]; then
|
||||||
TMP=tmp
|
tmpdir=$(mktemp -d)
|
||||||
mkdir "$TMP"
|
grep 'page 131' "$DATA_DIR"/rfc5545 >"$tmpdir"/apts
|
||||||
cp "$DATA_DIR"/conf "$TMP"
|
cp "$DATA_DIR"/conf "$DATA_DIR"/todo "$tmpdir"
|
||||||
sed -n '/page 131/p' "$DATA_DIR"/rfc5545 > "$TMP"/apts
|
"$CALCURSE" --read-only -D "$tmpdir" -Q --filter-type cal \
|
||||||
"$CALCURSE" -D "$TMP" -Q --filter-type cal --startday=08/01/1997 --range=31
|
--startday=08/01/1997 --range=31
|
||||||
sed 's/=monday/=sunday/' "$DATA_DIR"/conf > "$TMP"/conf
|
rm -rf "$tmpdir"
|
||||||
"$CALCURSE" -D "$TMP" -Q --filter-type cal --startday=08/01/1997 --range=31
|
|
||||||
rm -rf "$TMP"
|
tmpdir=$(mktemp -d)
|
||||||
|
grep 'page 131' "$DATA_DIR"/rfc5545 >"$tmpdir"/apts
|
||||||
|
cp "$DATA_DIR"/todo "$tmpdir"
|
||||||
|
sed 's/general.firstdayofweek=monday/general.firstdayofweek=sunday/' \
|
||||||
|
"$DATA_DIR"/conf >"$tmpdir"/conf
|
||||||
|
"$CALCURSE" --read-only -D "$tmpdir" -Q --filter-type cal \
|
||||||
|
--startday=08/01/1997 --range=31
|
||||||
|
rm -rf "$tmpdir"
|
||||||
elif [ "$1" = 'expected' ]; then
|
elif [ "$1" = 'expected' ]; then
|
||||||
cat <<EOD
|
cat <<EOD
|
||||||
08/05/97:
|
08/05/97:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user