From 2f3b41e6bf867ec7dd09cf8ae8bbc74db7a50029 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 6 Jul 2013 09:22:44 +0100 Subject: Implement --snapshot --- yarn.tests/snapshot.script | 71 ++++++++++++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 25 deletions(-) (limited to 'yarn.tests') diff --git a/yarn.tests/snapshot.script b/yarn.tests/snapshot.script index 90db93e..e8947ad 100755 --- a/yarn.tests/snapshot.script +++ b/yarn.tests/snapshot.script @@ -8,34 +8,55 @@ cat << EOF > "$DATADIR/foo.yarn" WHEN foo THEN foo - IMPLEMENTS GIVEN foo - touch "\$DATADIR/foo.given" + SCENARIO bar + GIVEN bar + WHEN bar + THEN bar - IMPLEMENTS WHEN foo - touch "\$DATADIR/foo.when" + IMPLEMENTS GIVEN (.*) + touch "\$DATADIR/\$MATCH_1.given" - IMPLEMENTS THEN foo - touch "\$DATADIR/foo.then" + IMPLEMENTS WHEN (.*) + touch "\$DATADIR/\$MATCH_1.when" + + IMPLEMENTS THEN (.*) + touch "\$DATADIR/\$MATCH_1.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" +test -e "$DATADIR/tmp/bar" +test -e "$DATADIR/tmp/bar/datadir" +test -e "$DATADIR/tmp/bar/datadir/bar.given" +test -e "$DATADIR/tmp/bar/datadir/bar.when" +test -e "$DATADIR/tmp/bar/datadir/bar.then" + +test -e "$DATADIR/tmp/bar/001-GIVEN-bar" +test -e "$DATADIR/tmp/bar/001-GIVEN-bar/bar.given" +! test -e "$DATADIR/tmp/bar/001-GIVEN-bar/bar.when" +! test -e "$DATADIR/tmp/bar/001-GIVEN-bar/bar.then" + +test -e "$DATADIR/tmp/bar/002-WHEN-bar" +test -e "$DATADIR/tmp/bar/002-WHEN-bar/bar.given" +test -e "$DATADIR/tmp/bar/002-WHEN-bar/bar.when" +! test -e "$DATADIR/tmp/bar/002-WHEN-bar/bar.then" + +test -e "$DATADIR/tmp/bar/003-THEN-bar" +test -e "$DATADIR/tmp/bar/003-THEN-bar/bar.given" +test -e "$DATADIR/tmp/bar/003-THEN-bar/bar.when" +test -e "$DATADIR/tmp/bar/003-THEN-bar/bar.then" + +test -e "$DATADIR/tmp/foo/001-GIVEN-foo" +test -e "$DATADIR/tmp/foo/001-GIVEN-foo/foo.given" +! test -e "$DATADIR/tmp/foo/001-GIVEN-foo/foo.when" +! test -e "$DATADIR/tmp/foo/001-GIVEN-foo/foo.then" + +test -e "$DATADIR/tmp/foo/002-WHEN-foo" +test -e "$DATADIR/tmp/foo/002-WHEN-foo/foo.given" +test -e "$DATADIR/tmp/foo/002-WHEN-foo/foo.when" +! test -e "$DATADIR/tmp/foo/002-WHEN-foo/foo.then" + +test -e "$DATADIR/tmp/foo/003-THEN-foo" +test -e "$DATADIR/tmp/foo/003-THEN-foo/foo.given" +test -e "$DATADIR/tmp/foo/003-THEN-foo/foo.when" +test -e "$DATADIR/tmp/foo/003-THEN-foo/foo.then" -- cgit v1.2.1