Skip to content

Commit

Permalink
tests: use "git xyzzy" form (t3600 - t6999)
Browse files Browse the repository at this point in the history
Converts tests between t3600-t6300.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Nanako Shiraishi authored and gitster committed Sep 3, 2008
1 parent 0cb0e14 commit 3604e7c
Show file tree
Hide file tree
Showing 26 changed files with 130 additions and 130 deletions.
4 changes: 2 additions & 2 deletions t/t3600-rm.sh
Expand Up @@ -12,14 +12,14 @@ test_expect_success \
'Initialize test directory' \ 'Initialize test directory' \
"touch -- foo bar baz 'space embedded' -q && "touch -- foo bar baz 'space embedded' -q &&
git add -- foo bar baz 'space embedded' -q && git add -- foo bar baz 'space embedded' -q &&
git-commit -m 'add normal files' && git commit -m 'add normal files' &&
test_tabs=y && test_tabs=y &&
if touch -- 'tab embedded' 'newline if touch -- 'tab embedded' 'newline
embedded' embedded'
then then
git add -- 'tab embedded' 'newline git add -- 'tab embedded' 'newline
embedded' && embedded' &&
git-commit -m 'add files with tabs and newlines' git commit -m 'add files with tabs and newlines'
else else
say 'Your filesystem does not allow tabs in filenames.' say 'Your filesystem does not allow tabs in filenames.'
test_tabs=n test_tabs=n
Expand Down
4 changes: 2 additions & 2 deletions t/t4012-diff-binary.sh
Expand Up @@ -61,7 +61,7 @@ test_expect_success 'apply detecting corrupt patch correctly' \
detected=`sed -ne "${detected}p" broken` && detected=`sed -ne "${detected}p" broken` &&
test "$detected" = xCIT' test "$detected" = xCIT'


test_expect_success 'initial commit' 'git-commit -a -m initial' test_expect_success 'initial commit' 'git commit -a -m initial'


# Try removal (b), modification (d), and creation (e). # Try removal (b), modification (d), and creation (e).
test_expect_success 'diff-index with --binary' \ test_expect_success 'diff-index with --binary' \
Expand All @@ -72,7 +72,7 @@ test_expect_success 'diff-index with --binary' \
git apply --stat --summary current' git apply --stat --summary current'


test_expect_success 'apply binary patch' \ test_expect_success 'apply binary patch' \
'git-reset --hard && 'git reset --hard &&
git apply --binary --index <current && git apply --binary --index <current &&
tree1=`git write-tree` && tree1=`git write-tree` &&
test "$tree1" = "$tree0"' test "$tree1" = "$tree0"'
Expand Down
26 changes: 13 additions & 13 deletions t/t4103-apply-binary.sh
Expand Up @@ -21,16 +21,16 @@ cat file1 >file2
cat file1 >file4 cat file1 >file4


git update-index --add --remove file1 file2 file4 git update-index --add --remove file1 file2 file4
git-commit -m 'Initial Version' 2>/dev/null git commit -m 'Initial Version' 2>/dev/null


git-checkout -b binary git checkout -b binary
perl -pe 'y/x/\000/' <file1 >file3 perl -pe 'y/x/\000/' <file1 >file3
cat file3 >file4 cat file3 >file4
git add file2 git add file2
perl -pe 'y/\000/v/' <file3 >file1 perl -pe 'y/\000/v/' <file3 >file1
rm -f file2 rm -f file2
git update-index --add --remove file1 file2 file3 file4 git update-index --add --remove file1 file2 file3 file4
git-commit -m 'Second Version' git commit -m 'Second Version'


git diff-tree -p master binary >B.diff git diff-tree -p master binary >B.diff
git diff-tree -p -C master binary >C.diff git diff-tree -p -C master binary >C.diff
Expand All @@ -39,47 +39,47 @@ git diff-tree -p --binary master binary >BF.diff
git diff-tree -p --binary -C master binary >CF.diff git diff-tree -p --binary -C master binary >CF.diff


test_expect_success 'stat binary diff -- should not fail.' \ test_expect_success 'stat binary diff -- should not fail.' \
'git-checkout master 'git checkout master
git apply --stat --summary B.diff' git apply --stat --summary B.diff'


test_expect_success 'stat binary diff (copy) -- should not fail.' \ test_expect_success 'stat binary diff (copy) -- should not fail.' \
'git-checkout master 'git checkout master
git apply --stat --summary C.diff' git apply --stat --summary C.diff'


test_expect_success 'check binary diff -- should fail.' \ test_expect_success 'check binary diff -- should fail.' \
'git-checkout master && 'git checkout master &&
test_must_fail git apply --check B.diff' test_must_fail git apply --check B.diff'


test_expect_success 'check binary diff (copy) -- should fail.' \ test_expect_success 'check binary diff (copy) -- should fail.' \
'git-checkout master && 'git checkout master &&
test_must_fail git apply --check C.diff' test_must_fail git apply --check C.diff'


test_expect_success \ test_expect_success \
'check incomplete binary diff with replacement -- should fail.' ' 'check incomplete binary diff with replacement -- should fail.' '
git-checkout master && git checkout master &&
test_must_fail git apply --check --allow-binary-replacement B.diff test_must_fail git apply --check --allow-binary-replacement B.diff
' '


test_expect_success \ test_expect_success \
'check incomplete binary diff with replacement (copy) -- should fail.' ' 'check incomplete binary diff with replacement (copy) -- should fail.' '
git-checkout master && git checkout master &&
test_must_fail git apply --check --allow-binary-replacement C.diff test_must_fail git apply --check --allow-binary-replacement C.diff
' '


test_expect_success 'check binary diff with replacement.' \ test_expect_success 'check binary diff with replacement.' \
'git-checkout master 'git checkout master
git apply --check --allow-binary-replacement BF.diff' git apply --check --allow-binary-replacement BF.diff'


test_expect_success 'check binary diff with replacement (copy).' \ test_expect_success 'check binary diff with replacement (copy).' \
'git-checkout master 'git checkout master
git apply --check --allow-binary-replacement CF.diff' git apply --check --allow-binary-replacement CF.diff'


# Now we start applying them. # Now we start applying them.


do_reset () { do_reset () {
rm -f file? && rm -f file? &&
git-reset --hard && git reset --hard &&
git-checkout -f master git checkout -f master
} }


test_expect_success 'apply binary diff -- should fail.' \ test_expect_success 'apply binary diff -- should fail.' \
Expand Down
2 changes: 1 addition & 1 deletion t/t4124-apply-ws-rule.sh
@@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh


test_description='core.whitespace rules and git-apply' test_description='core.whitespace rules and git apply'


. ./test-lib.sh . ./test-lib.sh


Expand Down
4 changes: 2 additions & 2 deletions t/t4127-apply-same-fn.sh
Expand Up @@ -26,7 +26,7 @@ test_expect_success 'apply same filename with independent changes' '
git diff >> patch0 && git diff >> patch0 &&
cp same_fn same_fn2 && cp same_fn same_fn2 &&
git reset --hard && git reset --hard &&
git-apply patch0 && git apply patch0 &&
diff same_fn same_fn2 diff same_fn same_fn2
' '


Expand All @@ -39,7 +39,7 @@ test_expect_success 'apply same filename with overlapping changes' '
git diff >> patch0 && git diff >> patch0 &&
cp same_fn same_fn2 && cp same_fn same_fn2 &&
git reset --hard && git reset --hard &&
git-apply patch0 && git apply patch0 &&
diff same_fn same_fn2 diff same_fn same_fn2
' '


Expand Down
2 changes: 1 addition & 1 deletion t/t4150-am.sh
Expand Up @@ -164,7 +164,7 @@ test_expect_success 'am --keep really keeps the subject' '
git checkout HEAD^ && git checkout HEAD^ &&
git am --keep patch4 && git am --keep patch4 &&
! test -d .git/rebase-apply && ! test -d .git/rebase-apply &&
git-cat-file commit HEAD | git cat-file commit HEAD |
grep -q -F "Re: Re: Re: [PATCH 1/5 v2] third" grep -q -F "Re: Re: Re: [PATCH 1/5 v2] third"
' '


Expand Down
4 changes: 2 additions & 2 deletions t/t4151-am-abort.sh
Expand Up @@ -44,14 +44,14 @@ do
' '


test_expect_success "am$with3 --skip continue after failed am$with3" ' test_expect_success "am$with3 --skip continue after failed am$with3" '
test_must_fail git-am$with3 --skip >output && test_must_fail git am$with3 --skip >output &&
test "$(grep "^Applying" output)" = "Applying: 6" && test "$(grep "^Applying" output)" = "Applying: 6" &&
test_cmp file-2-expect file-2 && test_cmp file-2-expect file-2 &&
test ! -f .git/rr-cache/MERGE_RR test ! -f .git/rr-cache/MERGE_RR
' '


test_expect_success "am --abort goes back after failed am$with3" ' test_expect_success "am --abort goes back after failed am$with3" '
git-am --abort && git am --abort &&
git rev-parse HEAD >actual && git rev-parse HEAD >actual &&
git rev-parse initial >expect && git rev-parse initial >expect &&
test_cmp expect actual && test_cmp expect actual &&
Expand Down
16 changes: 8 additions & 8 deletions t/t5300-pack-object.sh
Expand Up @@ -3,7 +3,7 @@
# Copyright (c) 2005 Junio C Hamano # Copyright (c) 2005 Junio C Hamano
# #


test_description='git-pack-object test_description='git pack-object
' '
. ./test-lib.sh . ./test-lib.sh
Expand Down Expand Up @@ -236,24 +236,24 @@ test_expect_success \
test_expect_success \ test_expect_success \
'build pack index for an existing pack' \ 'build pack index for an existing pack' \
'cat test-1-${packname_1}.pack >test-3.pack && 'cat test-1-${packname_1}.pack >test-3.pack &&
git-index-pack -o tmp.idx test-3.pack && git index-pack -o tmp.idx test-3.pack &&
cmp tmp.idx test-1-${packname_1}.idx && cmp tmp.idx test-1-${packname_1}.idx &&
git-index-pack test-3.pack && git index-pack test-3.pack &&
cmp test-3.idx test-1-${packname_1}.idx && cmp test-3.idx test-1-${packname_1}.idx &&
cat test-2-${packname_2}.pack >test-3.pack && cat test-2-${packname_2}.pack >test-3.pack &&
git-index-pack -o tmp.idx test-2-${packname_2}.pack && git index-pack -o tmp.idx test-2-${packname_2}.pack &&
cmp tmp.idx test-2-${packname_2}.idx && cmp tmp.idx test-2-${packname_2}.idx &&
git-index-pack test-3.pack && git index-pack test-3.pack &&
cmp test-3.idx test-2-${packname_2}.idx && cmp test-3.idx test-2-${packname_2}.idx &&
cat test-3-${packname_3}.pack >test-3.pack && cat test-3-${packname_3}.pack >test-3.pack &&
git-index-pack -o tmp.idx test-3-${packname_3}.pack && git index-pack -o tmp.idx test-3-${packname_3}.pack &&
cmp tmp.idx test-3-${packname_3}.idx && cmp tmp.idx test-3-${packname_3}.idx &&
git-index-pack test-3.pack && git index-pack test-3.pack &&
cmp test-3.idx test-3-${packname_3}.idx && cmp test-3.idx test-3-${packname_3}.idx &&
:' :'
Expand All @@ -266,7 +266,7 @@ test_expect_success \


test_expect_success \ test_expect_success \
'make sure index-pack detects the SHA1 collision' \ 'make sure index-pack detects the SHA1 collision' \
'test_must_fail git-index-pack -o bad.idx test-3.pack' 'test_must_fail git index-pack -o bad.idx test-3.pack'


test_expect_success \ test_expect_success \
'honor pack.packSizeLimit' \ 'honor pack.packSizeLimit' \
Expand Down
4 changes: 2 additions & 2 deletions t/t5301-sliding-window.sh
Expand Up @@ -19,7 +19,7 @@ test_expect_success \
tree=`git write-tree` && tree=`git write-tree` &&
commit1=`git commit-tree $tree </dev/null` && commit1=`git commit-tree $tree </dev/null` &&
git update-ref HEAD $commit1 && git update-ref HEAD $commit1 &&
git-repack -a -d && git repack -a -d &&
test "`git count-objects`" = "0 objects, 0 kilobytes" && test "`git count-objects`" = "0 objects, 0 kilobytes" &&
pack1=`ls .git/objects/pack/*.pack` && pack1=`ls .git/objects/pack/*.pack` &&
test -f "$pack1"' test -f "$pack1"'
Expand All @@ -45,7 +45,7 @@ test_expect_success \
git config core.packedGitLimit 512 && git config core.packedGitLimit 512 &&
commit2=`git commit-tree $tree -p $commit1 </dev/null` && commit2=`git commit-tree $tree -p $commit1 </dev/null` &&
git update-ref HEAD $commit2 && git update-ref HEAD $commit2 &&
git-repack -a -d && git repack -a -d &&
test "`git count-objects`" = "0 objects, 0 kilobytes" && test "`git count-objects`" = "0 objects, 0 kilobytes" &&
pack2=`ls .git/objects/pack/*.pack` && pack2=`ls .git/objects/pack/*.pack` &&
test -f "$pack2" test -f "$pack2"
Expand Down
12 changes: 6 additions & 6 deletions t/t5302-pack-index.sh
Expand Up @@ -48,11 +48,11 @@ test_expect_success \


test_expect_success \ test_expect_success \
'index-pack with index version 1' \ 'index-pack with index version 1' \
'git-index-pack --index-version=1 -o 1.idx "test-1-${pack1}.pack"' 'git index-pack --index-version=1 -o 1.idx "test-1-${pack1}.pack"'


test_expect_success \ test_expect_success \
'index-pack with index version 2' \ 'index-pack with index version 2' \
'git-index-pack --index-version=2 -o 2.idx "test-1-${pack1}.pack"' 'git index-pack --index-version=2 -o 2.idx "test-1-${pack1}.pack"'


test_expect_success \ test_expect_success \
'index-pack results should match pack-objects ones' \ 'index-pack results should match pack-objects ones' \
Expand Down Expand Up @@ -85,7 +85,7 @@ test_expect_success \
test "$have_64bits" && test "$have_64bits" &&
test_expect_success \ test_expect_success \
'index v2: force some 64-bit offsets with index-pack' \ 'index v2: force some 64-bit offsets with index-pack' \
'git-index-pack --index-version=2,0x40000 -o 3.idx "test-1-${pack1}.pack"' 'git index-pack --index-version=2,0x40000 -o 3.idx "test-1-${pack1}.pack"'


test "$have_64bits" && test "$have_64bits" &&
test_expect_success \ test_expect_success \
Expand All @@ -94,7 +94,7 @@ test_expect_success \


test_expect_success \ test_expect_success \
'[index v1] 1) stream pack to repository' \ '[index v1] 1) stream pack to repository' \
'git-index-pack --index-version=1 --stdin < "test-1-${pack1}.pack" && 'git index-pack --index-version=1 --stdin < "test-1-${pack1}.pack" &&
git prune-packed && git prune-packed &&
git count-objects | ( read nr rest && test "$nr" -eq 1 ) && git count-objects | ( read nr rest && test "$nr" -eq 1 ) &&
cmp "test-1-${pack1}.pack" ".git/objects/pack/pack-${pack1}.pack" && cmp "test-1-${pack1}.pack" ".git/objects/pack/pack-${pack1}.pack" &&
Expand Down Expand Up @@ -132,7 +132,7 @@ test_expect_success \
test_expect_success \ test_expect_success \
'[index v2] 1) stream pack to repository' \ '[index v2] 1) stream pack to repository' \
'rm -f .git/objects/pack/* && 'rm -f .git/objects/pack/* &&
git-index-pack --index-version=2 --stdin < "test-1-${pack1}.pack" && git index-pack --index-version=2 --stdin < "test-1-${pack1}.pack" &&
git prune-packed && git prune-packed &&
git count-objects | ( read nr rest && test "$nr" -eq 1 ) && git count-objects | ( read nr rest && test "$nr" -eq 1 ) &&
cmp "test-1-${pack1}.pack" ".git/objects/pack/pack-${pack1}.pack" && cmp "test-1-${pack1}.pack" ".git/objects/pack/pack-${pack1}.pack" &&
Expand Down Expand Up @@ -165,7 +165,7 @@ test_expect_success \
test_expect_success \ test_expect_success \
'[index v2] 6) verify-pack detects CRC mismatch' \ '[index v2] 6) verify-pack detects CRC mismatch' \
'rm -f .git/objects/pack/* && 'rm -f .git/objects/pack/* &&
git-index-pack --index-version=2 --stdin < "test-1-${pack1}.pack" && git index-pack --index-version=2 --stdin < "test-1-${pack1}.pack" &&
git verify-pack ".git/objects/pack/pack-${pack1}.pack" && git verify-pack ".git/objects/pack/pack-${pack1}.pack" &&
chmod +w ".git/objects/pack/pack-${pack1}.idx" && chmod +w ".git/objects/pack/pack-${pack1}.idx" &&
dd if=/dev/zero of=".git/objects/pack/pack-${pack1}.idx" conv=notrunc \ dd if=/dev/zero of=".git/objects/pack/pack-${pack1}.idx" conv=notrunc \
Expand Down
2 changes: 1 addition & 1 deletion t/t5305-include-tag.sh
@@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh


test_description='git-pack-object --include-tag' test_description='git pack-object --include-tag'
. ./test-lib.sh . ./test-lib.sh


TRASH=`pwd` TRASH=`pwd`
Expand Down
30 changes: 15 additions & 15 deletions t/t5400-send-pack.sh
Expand Up @@ -31,7 +31,7 @@ test_expect_success setup '
parent=$commit || return 1 parent=$commit || return 1
done && done &&
git update-ref HEAD "$commit" && git update-ref HEAD "$commit" &&
git-clone ./. victim && git clone ./. victim &&
cd victim && cd victim &&
git log && git log &&
cd .. && cd .. &&
Expand Down Expand Up @@ -68,7 +68,7 @@ test_expect_success 'pack the destination repository' '
test_expect_success \ test_expect_success \
'pushing rewound head should not barf but require --force' ' 'pushing rewound head should not barf but require --force' '
# should not fail but refuse to update. # should not fail but refuse to update.
if git-send-pack ./victim/.git/ master if git send-pack ./victim/.git/ master
then then
# now it should fail with Pasky patch # now it should fail with Pasky patch
echo >&2 Gaah, it should have failed. echo >&2 Gaah, it should have failed.
Expand All @@ -85,7 +85,7 @@ test_expect_success \
true true
fi && fi &&
# this should update # this should update
git-send-pack --force ./victim/.git/ master && git send-pack --force ./victim/.git/ master &&
cmp victim/.git/refs/heads/master .git/refs/heads/master cmp victim/.git/refs/heads/master .git/refs/heads/master
' '


Expand All @@ -95,7 +95,7 @@ test_expect_success \
git branch extra master && git branch extra master &&
cd .. && cd .. &&
test -f victim/.git/refs/heads/extra && test -f victim/.git/refs/heads/extra &&
git-send-pack ./victim/.git/ :extra master && git send-pack ./victim/.git/ :extra master &&
! test -f victim/.git/refs/heads/extra ! test -f victim/.git/refs/heads/extra
' '


Expand All @@ -109,27 +109,27 @@ test_expect_success \
git config receive.denyNonFastforwards true && git config receive.denyNonFastforwards true &&
cd .. && cd .. &&
git update-ref refs/heads/master master^ || return 1 git update-ref refs/heads/master master^ || return 1
git-send-pack --force ./victim/.git/ master && return 1 git send-pack --force ./victim/.git/ master && return 1
! test_cmp .git/refs/heads/master victim/.git/refs/heads/master ! test_cmp .git/refs/heads/master victim/.git/refs/heads/master
' '


test_expect_success \ test_expect_success \
'pushing does not include non-head refs' ' 'pushing does not include non-head refs' '
mkdir parent && cd parent && mkdir parent && cd parent &&
git-init && touch file && git-add file && git-commit -m add && git init && touch file && git add file && git commit -m add &&
cd .. && cd .. &&
git-clone parent child && cd child && git-push --all && git clone parent child && cd child && git push --all &&
cd ../parent && cd ../parent &&
git-branch -a >branches && ! grep origin/master branches git branch -a >branches && ! grep origin/master branches
' '


rewound_push_setup() { rewound_push_setup() {
rm -rf parent child && rm -rf parent child &&
mkdir parent && cd parent && mkdir parent && cd parent &&
git-init && echo one >file && git-add file && git-commit -m one && git init && echo one >file && git add file && git commit -m one &&
echo two >file && git-commit -a -m two && echo two >file && git commit -a -m two &&
cd .. && cd .. &&
git-clone parent child && cd child && git-reset --hard HEAD^ git clone parent child && cd child && git reset --hard HEAD^
} }


rewound_push_succeeded() { rewound_push_succeeded() {
Expand All @@ -148,26 +148,26 @@ rewound_push_failed() {
test_expect_success \ test_expect_success \
'pushing explicit refspecs respects forcing' ' 'pushing explicit refspecs respects forcing' '
rewound_push_setup && rewound_push_setup &&
if git-send-pack ../parent/.git refs/heads/master:refs/heads/master if git send-pack ../parent/.git refs/heads/master:refs/heads/master
then then
false false
else else
true true
fi && rewound_push_failed && fi && rewound_push_failed &&
git-send-pack ../parent/.git +refs/heads/master:refs/heads/master && git send-pack ../parent/.git +refs/heads/master:refs/heads/master &&
rewound_push_succeeded rewound_push_succeeded
' '


test_expect_success \ test_expect_success \
'pushing wildcard refspecs respects forcing' ' 'pushing wildcard refspecs respects forcing' '
rewound_push_setup && rewound_push_setup &&
if git-send-pack ../parent/.git refs/heads/*:refs/heads/* if git send-pack ../parent/.git refs/heads/*:refs/heads/*
then then
false false
else else
true true
fi && rewound_push_failed && fi && rewound_push_failed &&
git-send-pack ../parent/.git +refs/heads/*:refs/heads/* && git send-pack ../parent/.git +refs/heads/*:refs/heads/* &&
rewound_push_succeeded rewound_push_succeeded
' '


Expand Down

0 comments on commit 3604e7c

Please sign in to comment.