From: Karl Hasselström Date: Mon, 03 Sep 2007 00:00:00 GMT Subject: [StGit PATCH] Test "stg status" more thoroughly Message-ID: <20070902235947.23866.81320.stgit@yoghurt> Signed-off-by: Karl Hasselström --- t/t0002-status.sh | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 112 insertions(+), 2 deletions(-) diff --git a/t/t0002-status.sh b/t/t0002-status.sh index c088d56..ce3b688 100755 --- a/t/t0002-status.sh +++ b/t/t0002-status.sh @@ -8,8 +8,118 @@ test_description='Basic stg status Test that "stg status" works.' . ./test-lib.sh +stg init -test_expect_success 'Run status on empty' \ - 'stg status' +# Ignore our own output files. +cat > .git/info/exclude < expected.txt < output.txt && + diff -u expected.txt output.txt +' + +cat > expected.txt < output.txt && + diff -u expected.txt output.txt +' +rm -f foo + +cat > expected.txt < output.txt && + diff -u expected.txt output.txt +' + +cat > expected.txt < output.txt && + diff -u expected.txt output.txt +' + +cat > expected.txt < output.txt && + diff -u expected.txt output.txt +' + +cat > expected.txt < output.txt && + diff -u expected.txt output.txt +' + +cat > expected.txt <> foo/bar && + stg status > output.txt && + diff -u expected.txt output.txt +' + +cat > expected.txt < output.txt && + diff -u expected.txt output.txt +' + +test_expect_success 'Make a conflicting patch' ' + stg pop && + stg new -m "third patch" && + echo "woo" >> foo/bar && + stg refresh +' + +cat > expected.txt < output.txt && + diff -u expected.txt output.txt +' + +cat > expected.txt < output.txt && + diff -u expected.txt output.txt +' + +cat > expected.txt < output.txt && + diff -u expected.txt output.txt +' test_done