{"thread":{"id":"8001","subject":"[PATCH 1/3] t7300: Basic tests for git-clean","startedAt":"2007-05-06T18:09:08Z","lastAt":"2007-05-06T19:50:54Z","messageCount":4,"participants":["Michael Spang","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"41228","messageId":"463E19C4.8010601@uwaterloo.ca","threadId":"8001","inReplyTo":null,"subject":"[PATCH 1/3] t7300: Basic tests for git-clean","fromName":"Michael Spang","fromEmail":"mspang@uwaterloo.ca","sentAt":"2007-05-06T18:09:08Z","receivedAt":"2007-05-06T18:09:08Z","isPatch":true,"sender":{"key":"mspang@uwaterloo.ca","avatar":null},"body":"This tests the -d, -n, -f, -x, and -X options to git-clean.\n\nSigned-off-by: Michael Spang <mspang@uwaterloo.ca>\n---\n t/t7300-clean.sh |  157 ++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 157 insertions(+), 0 deletions(-)\n create mode 100755 t/t7300-clean.sh\n\ndiff --git a/t/t7300-clean.sh b/t/t7300-clean.sh\nnew file mode 100755\nindex 0000000..1fb3850\n--- /dev/null\n+++ b/t/t7300-clean.sh\n@@ -0,0 +1,157 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2007 Michael Spang\n+#\n+\n+test_description='git-clean basic tests'\n+\n+. ./test-lib.sh\n+\n+test_expect_success \\\n+    'setup' \\\n+    \"mkdir -p src &&\n+    touch src/part1.c Makefile &&\n+    echo build >> .gitignore &&\n+    echo *.o >> .gitignore &&\n+    git-add . &&\n+    git-commit -m setup &&\n+    touch src/part2.c README &&\n+    git-add .\"\n+\n+test_expect_success \\\n+    'git-clean' \\\n+    \"mkdir -p build docs &&\n+    touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n+    git-clean &&\n+    test -f Makefile &&\n+    test -f README &&\n+    test -f src/part1.c &&\n+    test -f src/part2.c &&\n+    test ! -e a.out &&\n+    test ! -e src/part3.c &&\n+    test -f docs/manual.txt &&\n+    test -f obj.o &&\n+    test -f build/lib.so\"\n+\n+test_expect_success \\\n+    'git-clean -n' \\\n+    \"mkdir -p build docs &&\n+    touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n+    git-clean -n &&\n+    test -f Makefile &&\n+    test -f README &&\n+    test -f src/part1.c &&\n+    test -f src/part2.c &&\n+    test -f a.out &&\n+    test -f src/part3.c &&\n+    test -f docs/manual.txt &&\n+    test -f obj.o &&\n+    test -f build/lib.so\"\n+\n+test_expect_success \\\n+    'git-clean -d' \\\n+    \"mkdir -p build docs &&\n+    touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n+    git-clean -d &&\n+    test -f Makefile &&\n+    test -f README &&\n+    test -f src/part1.c &&\n+    test -f src/part2.c &&\n+    test ! -e a.out &&\n+    test ! -e src/part3.c &&\n+    test ! -e docs &&\n+    test -f obj.o &&\n+    test -f build/lib.so\"\n+\n+test_expect_success \\\n+    'git-clean -x' \\\n+    \"mkdir -p build docs &&\n+    touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n+    git-clean -x &&\n+    test -f Makefile &&\n+    test -f README &&\n+    test -f src/part1.c &&\n+    test -f src/part2.c &&\n+    test ! -e a.out &&\n+    test ! -e src/part3.c &&\n+    test -f docs/manual.txt &&\n+    test ! -e obj.o &&\n+    test -f build/lib.so\"\n+\n+test_expect_success \\\n+    'git-clean -d -x' \\\n+    \"mkdir -p build docs &&\n+    touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n+    git-clean -d -x &&\n+    test -f Makefile &&\n+    test -f README &&\n+    test -f src/part1.c &&\n+    test -f src/part2.c &&\n+    test ! -e a.out &&\n+    test ! -e src/part3.c &&\n+    test ! -e docs &&\n+    test ! -e obj.o &&\n+    test ! -e build\"\n+\n+test_expect_success \\\n+    'git-clean -X' \\\n+    \"mkdir -p build docs &&\n+    touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n+    git-clean -X &&\n+    test -f Makefile &&\n+    test -f README &&\n+    test -f src/part1.c &&\n+    test -f src/part2.c &&\n+    test -f a.out &&\n+    test -f src/part3.c &&\n+    test -f docs/manual.txt &&\n+    test ! -e obj.o &&\n+    test -f build/lib.so\"\n+\n+test_expect_success \\\n+    'git-clean -d -X' \\\n+    \"mkdir -p build docs &&\n+    touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n+    git-clean -d -X &&\n+    test -f Makefile &&\n+    test -f README &&\n+    test -f src/part1.c &&\n+    test -f src/part2.c &&\n+    test -f a.out &&\n+    test -f src/part3.c &&\n+    test -f docs/manual.txt &&\n+    test ! -e obj.o &&\n+    test ! -e build\"\n+\n+test_expect_failure \\\n+    'clean.requireForce' \\\n+    \"mkdir -p build docs &&\n+    touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n+    git-config clean.requireForce true &&\n+    git-clean\"\n+\n+test_expect_success \\\n+    'clean.requireForce and -n' \\\n+    \"test -f Makefile &&\n+    test -f README &&\n+    test -f src/part1.c &&\n+    test -f src/part2.c &&\n+    test -f a.out &&\n+    test -f src/part3.c &&\n+    test -f docs/manual.txt &&\n+    test -f obj.o &&\n+    test -f build/lib.so\"\n+\n+test_expect_success \\\n+    'clean.requireForce and -f' \\\n+    \"git-clean -f &&\n+    test -f README &&\n+    test -f src/part1.c &&\n+    test -f src/part2.c &&\n+    test ! -e a.out &&\n+    test ! -e src/part3.c &&\n+    test -f docs/manual.txt &&\n+    test -f obj.o &&\n+    test -f build/lib.so\"\n+\n+test_done\n"},{"id":"41238","messageId":"463E27BC.5060604@uwaterloo.ca","threadId":"8001","inReplyTo":"463E19C4.8010601@uwaterloo.ca","subject":"[PATCH(amend)] Really run \"git-clean -n\" in test","fromName":"Michael Spang","fromEmail":"mspang@uwaterloo.ca","sentAt":"2007-05-06T19:08:44Z","receivedAt":"2007-05-06T19:08:44Z","isPatch":true,"sender":{"key":"mspang@uwaterloo.ca","avatar":null},"body":"Signed-off-by: Michael Spang <mspang@uwaterloo.ca>\n---\n\nWhoops.\n\n t/t7300-clean.sh |    9 +++++----\n 1 files changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t7300-clean.sh b/t/t7300-clean.sh\nindex 1fb3850..1ada8da 100755\n--- a/t/t7300-clean.sh\n+++ b/t/t7300-clean.sh\n@@ -125,14 +125,15 @@ test_expect_success \\\n \n test_expect_failure \\\n     'clean.requireForce' \\\n-    \"mkdir -p build docs &&\n-    touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n-    git-config clean.requireForce true &&\n+    \"git-config clean.requireForce true &&\n     git-clean\"\n \n test_expect_success \\\n     'clean.requireForce and -n' \\\n-    \"test -f Makefile &&\n+    \"mkdir -p build docs &&\n+    touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n+    git-clean -n &&\n+    test -f Makefile &&\n     test -f README &&\n     test -f src/part1.c &&\n     test -f src/part2.c &&\n"},{"id":"41240","messageId":"7vlkg1bw17.fsf@assigned-by-dhcp.cox.net","threadId":"8001","inReplyTo":"463E27BC.5060604@uwaterloo.ca","subject":"Re: [PATCH(amend)] Really run \"git-clean -n\" in test","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-06T19:18:44Z","receivedAt":"2007-05-06T19:18:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael Spang <mspang@uwaterloo.ca> writes:\n\n> Signed-off-by: Michael Spang <mspang@uwaterloo.ca>\n> ---\n>\n> Whoops.\n>\n>  t/t7300-clean.sh |    9 +++++----\n>  1 files changed, 5 insertions(+), 4 deletions(-)\n\nOops indeed.\n\n* This is not an \"amend\"; you are following up an earlier patch of\n  your own.  Marking such a patch as \"amend\" is only confusing.\n  Please do not do it.\n\n>  test_expect_failure \\\n>      'clean.requireForce' \\\n> -    \"mkdir -p build docs &&\n> -    touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n> -    git-config clean.requireForce true &&\n> +    \"git-config clean.requireForce true &&\n>      git-clean\"\n\n* Please do not do this.  test_expect_failure, unless used for a\n  very simple single test, is almost always a bug.  You would\n  not know which step of && chain failed, even though you may be\n  expecting the failure from the last one.\n\n* I do not think a \"this reformats every existing tests\" patch\n  is needed nor wanted, but at least I'd like to see new scripts\n  and updates to the existing ones to be consistently formatted\n  like this:\n\n\ttest_expect_success 'name of the test' '\n\n\t\ttest body goes here &&\n                like this &&\n\t\tand this\n\n\t'\n"},{"id":"41242","messageId":"463E319E.8020304@uwaterloo.ca","threadId":"8001","inReplyTo":"7vlkg1bw17.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] t7300: Basic tests for git-clean","fromName":"Michael Spang","fromEmail":"mspang@uwaterloo.ca","sentAt":"2007-05-06T19:50:54Z","receivedAt":"2007-05-06T19:50:54Z","isPatch":true,"sender":{"key":"mspang@uwaterloo.ca","avatar":null},"body":"This tests the -d, -n, -f, -x, and -X options to git-clean.\n\nSigned-off-by: Michael Spang <mspang@uwaterloo.ca>\n---\n\nThis replaces 1/3 and the \"amend\".\n\nI guess this is the desired format? The email you sent seemed to have\nspaces on one of the lines, the others had tabs so I am using tabs.\n\n\n t/t7300-clean.sh |  180 ++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 180 insertions(+), 0 deletions(-)\n create mode 100755 t/t7300-clean.sh\n\ndiff --git a/t/t7300-clean.sh b/t/t7300-clean.sh\nnew file mode 100755\nindex 0000000..5c31e94\n--- /dev/null\n+++ b/t/t7300-clean.sh\n@@ -0,0 +1,180 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2007 Michael Spang\n+#\n+\n+test_description='git-clean basic tests'\n+\n+. ./test-lib.sh\n+\n+test_expect_success 'setup' '\n+\n+\tmkdir -p src &&\n+\ttouch src/part1.c Makefile &&\n+\techo build >> .gitignore &&\n+\techo *.o >> .gitignore &&\n+\tgit-add . &&\n+\tgit-commit -m setup &&\n+\ttouch src/part2.c README &&\n+\tgit-add .\n+\n+'\n+\n+test_expect_success 'git-clean' '\n+\n+\tmkdir -p build docs &&\n+\ttouch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n+\tgit-clean &&\n+\ttest -f Makefile &&\n+\ttest -f README &&\n+\ttest -f src/part1.c &&\n+\ttest -f src/part2.c &&\n+\ttest ! -e a.out &&\n+\ttest ! -e src/part3.c &&\n+\ttest -f docs/manual.txt &&\n+\ttest -f obj.o &&\n+\ttest -f build/lib.so\n+\n+'\n+\n+test_expect_success 'git-clean -n' '\n+\n+\tmkdir -p build docs &&\n+\ttouch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n+\tgit-clean -n &&\n+\ttest -f Makefile &&\n+\ttest -f README &&\n+\ttest -f src/part1.c &&\n+\ttest -f src/part2.c &&\n+\ttest -f a.out &&\n+\ttest -f src/part3.c &&\n+\ttest -f docs/manual.txt &&\n+\ttest -f obj.o &&\n+\ttest -f build/lib.so\n+\n+'\n+\n+test_expect_success 'git-clean -d' '\n+\n+\tmkdir -p build docs &&\n+\ttouch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n+\tgit-clean -d &&\n+\ttest -f Makefile &&\n+\ttest -f README &&\n+\ttest -f src/part1.c &&\n+\ttest -f src/part2.c &&\n+\ttest ! -e a.out &&\n+\ttest ! -e src/part3.c &&\n+\ttest ! -e docs &&\n+\ttest -f obj.o &&\n+\ttest -f build/lib.so\n+\n+'\n+\n+test_expect_success 'git-clean -x' '\n+\n+\tmkdir -p build docs &&\n+\ttouch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n+\tgit-clean -x &&\n+\ttest -f Makefile &&\n+\ttest -f README &&\n+\ttest -f src/part1.c &&\n+\ttest -f src/part2.c &&\n+\ttest ! -e a.out &&\n+\ttest ! -e src/part3.c &&\n+\ttest -f docs/manual.txt &&\n+\ttest ! -e obj.o &&\n+\ttest -f build/lib.so\n+\n+'\n+\n+test_expect_success 'git-clean -d -x' '\n+\n+\tmkdir -p build docs &&\n+\ttouch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n+\tgit-clean -d -x &&\n+\ttest -f Makefile &&\n+\ttest -f README &&\n+\ttest -f src/part1.c &&\n+\ttest -f src/part2.c &&\n+\ttest ! -e a.out &&\n+\ttest ! -e src/part3.c &&\n+\ttest ! -e docs &&\n+\ttest ! -e obj.o &&\n+\ttest ! -e build\n+\n+'\n+\n+test_expect_success 'git-clean -X' '\n+\n+\tmkdir -p build docs &&\n+\ttouch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n+\tgit-clean -X &&\n+\ttest -f Makefile &&\n+\ttest -f README &&\n+\ttest -f src/part1.c &&\n+\ttest -f src/part2.c &&\n+\ttest -f a.out &&\n+\ttest -f src/part3.c &&\n+\ttest -f docs/manual.txt &&\n+\ttest ! -e obj.o &&\n+\ttest -f build/lib.so\n+\n+'\n+\n+test_expect_success 'git-clean -d -X' '\n+\n+\tmkdir -p build docs &&\n+\ttouch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n+\tgit-clean -d -X &&\n+\ttest -f Makefile &&\n+\ttest -f README &&\n+\ttest -f src/part1.c &&\n+\ttest -f src/part2.c &&\n+\ttest -f a.out &&\n+\ttest -f src/part3.c &&\n+\ttest -f docs/manual.txt &&\n+\ttest ! -e obj.o &&\n+\ttest ! -e build\n+\n+'\n+\n+test_expect_success 'clean.requireForce' '\n+\n+\tgit-config clean.requireForce true &&\n+\t! git-clean\n+\n+'\n+\n+test_expect_success 'clean.requireForce and -n' '\n+\n+\tmkdir -p build docs &&\n+\ttouch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n+\tgit-clean -n &&\n+\ttest -f Makefile &&\n+\ttest -f README &&\n+\ttest -f src/part1.c &&\n+\ttest -f src/part2.c &&\n+\ttest -f a.out &&\n+\ttest -f src/part3.c &&\n+\ttest -f docs/manual.txt &&\n+\ttest -f obj.o &&\n+\ttest -f build/lib.so\n+\n+'\n+\n+test_expect_success 'clean.requireForce and -f' '\n+\n+\tgit-clean -f &&\n+\ttest -f README &&\n+\ttest -f src/part1.c &&\n+\ttest -f src/part2.c &&\n+\ttest ! -e a.out &&\n+\ttest ! -e src/part3.c &&\n+\ttest -f docs/manual.txt &&\n+\ttest -f obj.o &&\n+\ttest -f build/lib.so\n+\n+'\n+\n+test_done\n-- \n1.5.2.rc1.4.g47e1\n"}]}