X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/fbc4cbf44108acfa7a563bc848402a0523081ccc..4c47af784eb3357a403360e871c6e15a6ca70b39:/t/t0002-status.sh diff --git a/t/t0002-status.sh b/t/t0002-status.sh index c088d56..2512c53 100755 --- a/t/t0002-status.sh +++ b/t/t0002-status.sh @@ -8,8 +8,185 @@ 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 && + test_cmp expected.txt output.txt +' + +cat > expected.txt < output.txt && + test_cmp expected.txt output.txt +' +rm -f foo + +cat > expected.txt < output.txt && + test_cmp expected.txt output.txt +' + +cat > expected.txt < output.txt && + test_cmp expected.txt output.txt +' + +cat > expected.txt < output.txt && + test_cmp expected.txt output.txt +' + +cat > expected.txt < output.txt && + test_cmp expected.txt output.txt +' + +cat > expected.txt < output.txt && + test_cmp expected.txt output.txt +' + +cat > expected.txt <> foo/bar && + stg status > output.txt && + test_cmp expected.txt output.txt +' + +cat > expected.txt < output.txt && + test_cmp expected.txt output.txt +' + +test_expect_success 'Add another file' ' + echo lajbans > fie && + git add fie && + stg refresh +' + +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 && + test_cmp expected.txt output.txt +' + +cat > expected.txt < output.txt && + test_cmp expected.txt output.txt +' + +cat > expected.txt < output.txt && + test_cmp expected.txt output.txt +' + +cat > expected.txt < output.txt && + test_cmp expected.txt output.txt +' + +cat > expected.txt < output.txt && + test_cmp expected.txt output.txt +' + +cat > expected.txt < output.txt && + test_cmp expected.txt output.txt +' + +cat > expected.txt < output.txt && + test_cmp expected.txt output.txt +' + +cat > expected.txt < output.txt && + test_cmp expected.txt output.txt +' + +test_expect_success 'Status after renaming a file (with rename detection)' ' + git config stgit.diff-opts -M && + stg status > output.txt && + test_cmp expected.txt output.txt +' test_done