From 4747bbd187d27fabef1e9514ebcec584980400e3 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 6 Jul 2013 08:51:32 +0100 Subject: Add test case for snapshotting --- yarn.tests/snapshot.script | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 yarn.tests/snapshot.script (limited to 'yarn.tests') diff --git a/yarn.tests/snapshot.script b/yarn.tests/snapshot.script new file mode 100755 index 0000000..90db93e --- /dev/null +++ b/yarn.tests/snapshot.script @@ -0,0 +1,41 @@ +#!/bin/sh + +set -eu + +cat << EOF > "$DATADIR/foo.yarn" + SCENARIO foo + GIVEN foo + WHEN foo + THEN foo + + IMPLEMENTS GIVEN foo + touch "\$DATADIR/foo.given" + + IMPLEMENTS WHEN foo + touch "\$DATADIR/foo.when" + + IMPLEMENTS THEN foo + touch "\$DATADIR/foo.then" +EOF + +./yarn -q --snapshot --tempdir "$DATADIR/tmp" "$DATADIR/foo.yarn" + +test -e "$DATADIR/tmp/001-GIVEN-foo" +test -e "$DATADIR/tmp/001-GIVEN-foo/foo.given" +! test -e "$DATADIR/tmp/datadir/foo.when" +! test -e "$DATADIR/tmp/datadir/foo.then" + +test -e "$DATADIR/tmp/002-WHEN-foo" +test -e "$DATADIR/tmp/002-WHEN-foo/foo.given" +test -e "$DATADIR/tmp/002-WHEN-foo/foo.when" +! test -e "$DATADIR/tmp/002-WHEN-foo/foo.then" + +test -e "$DATADIR/tmp/003-THEN-foo" +test -e "$DATADIR/tmp/003-THEN-foo/foo.given" +test -e "$DATADIR/tmp/003-THEN-foo/foo.when" +test -e "$DATADIR/tmp/003-THEN-foo/foo.then" + +test -e "$DATADIR/tmp/datadir" +test -e "$DATADIR/tmp/datadir/foo.given" +test -e "$DATADIR/tmp/datadir/foo.when" +test -e "$DATADIR/tmp/datadir/foo.then" -- cgit v1.2.1