X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft0000-basic.sh;h=27b54cbb1216beef8b5f315708574825a1c81da3;hb=adf59ec127f447aa83c84f9dbe2ae4e6417f3760;hp=4e49d590651363631a1f3a795d3c1679a70fb05f;hpb=f1a8cc635455a65567d040349327b9ea4adb479b;p=git.git diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh index 4e49d5906..27b54cbb1 100755 --- a/t/t0000-basic.sh +++ b/t/t0000-basic.sh @@ -46,13 +46,25 @@ test_expect_success \ '.git/objects should have 3 subdirectories.' \ 'test $(wc -l < full-of-directories) = 3' +################################################################ +# Test harness +test_expect_success 'success is reported like this' ' + : +' +test_expect_failure 'pretend we have a known breakage' ' + false +' +test_expect_failure 'pretend we have fixed a known breakage' ' + : +' + ################################################################ # Basics of the basics # updating a new file without --add should fail. -test_expect_failure \ - 'git update-index without --add should fail adding.' \ - 'git update-index should-be-empty' +test_expect_success 'git update-index without --add should fail adding.' ' + ! git update-index should-be-empty +' # and with --add it should succeed, even if it is empty (it used to fail). test_expect_success \ @@ -70,9 +82,9 @@ test_expect_success \ # Removing paths. rm -f should-be-empty full-of-directories -test_expect_failure \ - 'git update-index without --remove should fail removing.' \ - 'git update-index should-be-empty' +test_expect_success 'git update-index without --remove should fail removing.' ' + ! git update-index should-be-empty +' test_expect_success \ 'git update-index with --remove should be able to remove.' \ @@ -204,9 +216,9 @@ test_expect_success \ 'put invalid objects into the index.' \ 'git update-index --index-info < badobjects' -test_expect_failure \ - 'writing this tree without --missing-ok.' \ - 'git write-tree' +test_expect_success 'writing this tree without --missing-ok.' ' + ! git write-tree +' test_expect_success \ 'writing this tree with --missing-ok.' \ @@ -292,9 +304,31 @@ test_expect_success 'absolute path works as expected' ' test "$dir" = "$(test-absolute-path $dir2)" && file="$dir"/index && test "$file" = "$(test-absolute-path $dir2/index)" && + basename=blub && + test "$dir/$basename" = $(cd .git && test-absolute-path $basename) && ln -s ../first/file .git/syml && sym="$(cd first; pwd -P)"/file && test "$sym" = "$(test-absolute-path $dir2/syml)" ' +test_expect_success 'very long name in the index handled sanely' ' + + a=a && # 1 + a=$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a && # 16 + a=$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a && # 256 + a=$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a && # 4096 + a=${a}q && + + >path4 && + git update-index --add path4 && + ( + git ls-files -s path4 | + sed -e "s/ .*/ /" | + tr -d "\012" + echo "$a" + ) | git update-index --index-info && + len=$(git ls-files "a*" | wc -c) && + test $len = 4098 +' + test_done