ls-files --others --directory: test
Add a test to run with --directory option. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Jan 7, 2006 at 14:17 UTC
78c2cff61f87d43c1f4ef5a03547f093c4c6e0c9
1 file changed
+28
-6
t/t3000-ls-files-others.sh
+28
-6
@@ -11,24 +11,46 @@ filesystem.
11
path0 - a file
12
path1 - a symlink
13
path2/file2 - a file in a directory
14
+ path3-junk - a file to confuse things
15
+ path3/file3 - a file in a directory
16
'
17
. ./test-lib.sh
18
19
date >path0
20
ln -s xyzzy path1
19
-mkdir path2
21
+mkdir path2 path3
22
date >path2/file2
21
-test_expect_success \
22
- 'git-ls-files --others to show output.' \
23
- 'git-ls-files --others >output'
24
-cat >expected <<EOF
23
+date >path2-junk
24
+date >path3/file3
25
+date >path3-junk
26
+git-update-index --add path3-junk path3/file3
27
+
28
+cat >expected1 <<EOF
29
+expected1
30
+expected2
31
output
32
path0
33
path1
34
+path2-junk
35
path2/file2
36
EOF
37
+sed -e 's|path2/file2|path2/|' <expected1 >expected2
38
+
39
+test_expect_success \
40
+ 'git-ls-files --others to show output.' \
41
+ 'git-ls-files --others >output'
42
43
test_expect_success \
44
'git-ls-files --others should pick up symlinks.' \
33
- 'diff output expected'
45
+ 'diff output expected1'
46
+
47
+test_expect_success \
48
+ 'git-ls-files --others --directory to show output.' \
49
+ 'git-ls-files --others --directory >output'
50
+
51
+
52
+test_expect_success \
53
+ 'git-ls-files --others --directory should not get confused.' \
54
+ 'diff output expected2'
55
+
56
test_done