Skip to content

Commit

Permalink
t3010: modernize style
Browse files Browse the repository at this point in the history
In particular:

- move test preparations inside test_expect_success

- place test description on the test_expect_success line

- indent with a tab

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Johannes Sixt authored and Junio C Hamano committed Jun 7, 2013
1 parent 926e894 commit cb64868
Showing 1 changed file with 61 additions and 62 deletions.
123 changes: 61 additions & 62 deletions t/t3010-ls-files-killed-modified.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,71 +37,70 @@ modified without reporting path9 and path10.
'
. ./test-lib.sh

date >path0
if test_have_prereq SYMLINKS
then
ln -s xyzzy path1
else
date > path1
fi
mkdir path2 path3
date >path2/file2
date >path3/file3
: >path7
date >path8
: >path9
date >path10
test_expect_success \
'git update-index --add to add various paths.' \
"git update-index --add -- path0 path1 path?/file? path7 path8 path9 path10"

rm -fr path? ;# leave path10 alone
date >path2
if test_have_prereq SYMLINKS
then
ln -s frotz path3
ln -s nitfol path5
else
date > path3
date > path5
fi
mkdir path0 path1 path6
date >path0/file0
date >path1/file1
date >path6/file6
date >path7
: >path8
: >path9
touch path10
test_expect_success 'git update-index --add to add various paths.' '
date >path0 &&
if test_have_prereq SYMLINKS
then
ln -s xyzzy path1
else
date > path1
fi &&
mkdir path2 path3 &&
date >path2/file2 &&
date >path3/file3 &&
: >path7 &&
date >path8 &&
: >path9 &&
date >path10 &&
git update-index --add -- path0 path1 path?/file? path7 path8 path9 path10 &&
rm -fr path? # leave path10 alone
'

test_expect_success \
'git ls-files -k to show killed files.' \
'git ls-files -k >.output'
cat >.expected <<EOF
path0/file0
path1/file1
path2
path3
EOF
test_expect_success 'git ls-files -k to show killed files.' '
date >path2 &&
if test_have_prereq SYMLINKS
then
ln -s frotz path3 &&
ln -s nitfol path5
else
date >path3 &&
date >path5
fi &&
mkdir path0 path1 path6 &&
date >path0/file0 &&
date >path1/file1 &&
date >path6/file6 &&
date >path7 &&
: >path8 &&
: >path9 &&
touch path10 &&
git ls-files -k >.output
'

test_expect_success \
'validate git ls-files -k output.' \
'test_cmp .expected .output'
test_expect_success 'validate git ls-files -k output.' '
cat >.expected <<-\EOF &&
path0/file0
path1/file1
path2
path3
EOF
test_cmp .expected .output
'

test_expect_success \
'git ls-files -m to show modified files.' \
'git ls-files -m >.output'
cat >.expected <<EOF
path0
path1
path2/file2
path3/file3
path7
path8
EOF
test_expect_success 'git ls-files -m to show modified files.' '
git ls-files -m >.output
'

test_expect_success \
'validate git ls-files -m output.' \
'test_cmp .expected .output'
test_expect_success 'validate git ls-files -m output.' '
cat >.expected <<-\EOF &&
path0
path1
path2/file2
path3/file3
path7
path8
EOF
test_cmp .expected .output
'

test_done

0 comments on commit cb64868

Please sign in to comment.