t0003: remove extra whitespaces
The test had excess whitespaces everywhere that made it harder to read than necessary. Remove them. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Sep 22, 2011 at 16:34 UTC
78cec75747995a8613a8f27625aeaa4ec4b19651
1 file changed
+22
-46
t/t0003-attributes.sh
+22
-46
@@ -5,20 +5,16 @@ test_description=gitattributes
5
. ./test-lib.sh
6
7
attr_check () {
8
-
9
- path="$1"
10
- expect="$2"
8
+ path="$1" expect="$2"
9
10
git check-attr test -- "$path" >actual 2>err &&
11
echo "$path: test: $2" >expect &&
12
test_cmp expect actual &&
13
test_line_count = 0 err
16
-
14
}
15
16
17
test_expect_success 'setup' '
21
-
18
mkdir -p a/b/d a/c b &&
19
(
20
echo "[attr]notest !test"
@@ -40,29 +36,27 @@ test_expect_success 'setup' '
36
(
37
echo "global test=global"
38
) >"$HOME"/global-gitattributes &&
43
- cat <<EOF >expect-all
44
-f: test: f
45
-a/f: test: f
46
-a/c/f: test: f
47
-a/g: test: a/g
48
-a/b/g: test: a/b/g
49
-b/g: test: unspecified
50
-a/b/h: test: a/b/h
51
-a/b/d/g: test: a/b/d/*
52
-onoff: test: unset
53
-offon: test: set
54
-no: notest: set
55
-no: test: unspecified
56
-a/b/d/no: notest: set
57
-a/b/d/no: test: a/b/d/*
58
-a/b/d/yes: notest: set
59
-a/b/d/yes: test: unspecified
60
-EOF
61
-
39
+ cat <<-EOF >expect-all
40
+ f: test: f
41
+ a/f: test: f
42
+ a/c/f: test: f
43
+ a/g: test: a/g
44
+ a/b/g: test: a/b/g
45
+ b/g: test: unspecified
46
+ a/b/h: test: a/b/h
47
+ a/b/d/g: test: a/b/d/*
48
+ onoff: test: unset
49
+ offon: test: set
50
+ no: notest: set
51
+ no: test: unspecified
52
+ a/b/d/no: notest: set
53
+ a/b/d/no: test: a/b/d/*
54
+ a/b/d/yes: notest: set
55
+ a/b/d/yes: test: unspecified
56
+ EOF
57
'
58
59
test_expect_success 'command line checks' '
65
-
60
test_must_fail git check-attr &&
61
test_must_fail git check-attr -- &&
62
test_must_fail git check-attr test &&
@@ -72,11 +66,9 @@ test_expect_success 'command line checks' '
66
echo "f" | test_must_fail git check-attr --stdin -- f &&
67
echo "f" | test_must_fail git check-attr --stdin test -- f &&
68
test_must_fail git check-attr "" -- f
75
-
69
'
70
71
test_expect_success 'attribute test' '
79
-
72
attr_check f f &&
73
attr_check a/f f &&
74
attr_check a/c/f f &&
@@ -90,20 +82,16 @@ test_expect_success 'attribute test' '
82
attr_check no unspecified &&
83
attr_check a/b/d/no "a/b/d/*" &&
84
attr_check a/b/d/yes unspecified
93
-
85
'
86
87
test_expect_success 'unnormalized paths' '
97
-
88
attr_check ./f f &&
89
attr_check ./a/g a/g &&
90
attr_check a/./g a/g &&
91
attr_check a/c/../b/g a/b/g
102
-
92
'
93
94
test_expect_success 'relative paths' '
106
-
95
(cd a && attr_check ../f f) &&
96
(cd a && attr_check f f) &&
97
(cd a && attr_check i a/i) &&
@@ -112,7 +100,6 @@ test_expect_success 'relative paths' '
100
(cd b && attr_check ../a/f f) &&
101
(cd b && attr_check ../a/g a/g) &&
102
(cd b && attr_check ../a/b/g a/b/g)
115
-
103
'
104
105
test_expect_success 'core.attributesfile' '
@@ -121,19 +108,17 @@ test_expect_success 'core.attributesfile' '
108
attr_check global global &&
109
git config core.attributesfile "~/global-gitattributes" &&
110
attr_check global global &&
124
- echo "global test=precedence" >> .gitattributes &&
111
+ echo "global test=precedence" >>.gitattributes &&
112
attr_check global precedence
113
'
114
115
test_expect_success 'attribute test: read paths from stdin' '
129
-
130
- grep -v notest < expect-all > expect &&
131
- sed -e "s/:.*//" < expect | git check-attr --stdin test > actual &&
116
+ grep -v notest <expect-all >expect &&
117
+ sed -e "s/:.*//" <expect | git check-attr --stdin test >actual &&
118
test_cmp expect actual
119
'
120
121
test_expect_success 'attribute test: --all option' '
136
-
122
grep -v unspecified <expect-all | sort >specified-all &&
123
sed -e "s/:.*//" <expect-all | uniq >stdin-all &&
124
git check-attr --stdin --all <stdin-all | sort >actual &&
@@ -141,7 +126,6 @@ test_expect_success 'attribute test: --all option' '
126
'
127
128
test_expect_success 'attribute test: --cached option' '
144
-
129
: >empty &&
130
git check-attr --cached --stdin --all <stdin-all | sort >actual &&
131
test_cmp empty actual &&
@@ -151,21 +135,16 @@ test_expect_success 'attribute test: --cached option' '
135
'
136
137
test_expect_success 'root subdir attribute test' '
154
-
138
attr_check a/i a/i &&
139
attr_check subdir/a/i unspecified
157
-
140
'
141
142
test_expect_success 'setup bare' '
161
-
143
git clone --bare . bare.git &&
144
cd bare.git
164
-
145
'
146
147
test_expect_success 'bare repository: check that .gitattribute is ignored' '
168
-
148
(
149
echo "f test=f"
150
echo "a/i test=a/i"
@@ -175,7 +154,6 @@ test_expect_success 'bare repository: check that .gitattribute is ignored' '
154
attr_check a/c/f unspecified &&
155
attr_check a/i unspecified &&
156
attr_check subdir/a/i unspecified
178
-
157
'
158
159
test_expect_success 'bare repository: check that --cached honors index' '
@@ -186,7 +164,6 @@ test_expect_success 'bare repository: check that --cached honors index' '
164
'
165
166
test_expect_success 'bare repository: test info/attributes' '
189
-
167
(
168
echo "f test=f"
169
echo "a/i test=a/i"
@@ -196,7 +173,6 @@ test_expect_success 'bare repository: test info/attributes' '
173
attr_check a/c/f f &&
174
attr_check a/i a/i &&
175
attr_check subdir/a/i unspecified
199
-
176
'
177
178
test_done