t0025: rename the test files

The current test files are named one, two and three. Make it clearer what the tests do and rename them into LFonly, CRLFonly and LFwithNUL. After the renaming we can see easier that we may want more test cases for 2 types of files: - files which have mixed LF and CRLF line endings, - files which have mixed LF and CR line endings. See commit fd6cce9e, "Add per-repository eol normalization" and "the new safer autocrlf handling" in convert.c Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Torsten Bögershausen committed Jun 29, 2014 at 08:34 UTC b0cdb4dafc8531f16c3e0e0327bc03ca96dad9fe
1 file changed +61 -61
t/t0025-crlf-auto.sh
+61 -61
@@ -12,144 +12,144 @@ test_expect_success setup '
12
13 git config core.autocrlf false &&
14
15 - for w in Hello world how are you; do echo $w; done >one &&
16 - for w in I am very very fine thank you; do echo ${w}Q; done | q_to_cr >two &&
17 - for w in Oh here is a QNUL byte how alarming; do echo ${w}; done | q_to_nul >three &&
15 + for w in Hello world how are you; do echo $w; done >LFonly &&
16 + for w in I am very very fine thank you; do echo ${w}Q; done | q_to_cr >CRLFonly &&
17 + for w in Oh here is a QNUL byte how alarming; do echo ${w}; done | q_to_nul >LFwithNUL &&
18 git add . &&
19
20 git commit -m initial &&
21
22 - one=$(git rev-parse HEAD:one) &&
23 - two=$(git rev-parse HEAD:two) &&
24 - three=$(git rev-parse HEAD:three) &&
22 + LFonly=$(git rev-parse HEAD:LFonly) &&
23 + CRLFonly=$(git rev-parse HEAD:CRLFonly) &&
24 + LFwithNUL=$(git rev-parse HEAD:LFwithNUL) &&
25
26 echo happy.
27 '
28
29 test_expect_success 'default settings cause no changes' '
30
31 - rm -f .gitattributes tmp one two three &&
31 + rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
32 git read-tree --reset -u HEAD &&
33
34 - ! has_cr one &&
35 - has_cr two &&
36 - onediff=$(git diff one) &&
37 - twodiff=$(git diff two) &&
38 - threediff=$(git diff three) &&
39 - test -z "$onediff" && test -z "$twodiff" && test -z "$threediff"
34 + ! has_cr LFonly &&
35 + has_cr CRLFonly &&
36 + LFonlydiff=$(git diff LFonly) &&
37 + CRLFonlydiff=$(git diff CRLFonly) &&
38 + LFwithNULdiff=$(git diff LFwithNUL) &&
39 + test -z "$LFonlydiff" -a -z "$CRLFonlydiff" -a -z "$LFwithNULdiff"
40 '
41
42 test_expect_success 'crlf=true causes a CRLF file to be normalized' '
43
44 # Backwards compatibility check
45 - rm -f .gitattributes tmp one two three &&
46 - echo "two crlf" > .gitattributes &&
45 + rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
46 + echo "CRLFonly crlf" > .gitattributes &&
47 git read-tree --reset -u HEAD &&
48
49 # Note, "normalized" means that git will normalize it if added
50 - has_cr two &&
51 - twodiff=$(git diff two) &&
52 - test -n "$twodiff"
50 + has_cr CRLFonly &&
51 + CRLFonlydiff=$(git diff CRLFonly) &&
52 + test -n "$CRLFonlydiff"
53 '
54
55 test_expect_success 'text=true causes a CRLF file to be normalized' '
56
57 - rm -f .gitattributes tmp one two three &&
58 - echo "two text" > .gitattributes &&
57 + rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
58 + echo "CRLFonly text" > .gitattributes &&
59 git read-tree --reset -u HEAD &&
60
61 # Note, "normalized" means that git will normalize it if added
62 - has_cr two &&
63 - twodiff=$(git diff two) &&
64 - test -n "$twodiff"
62 + has_cr CRLFonly &&
63 + CRLFonlydiff=$(git diff CRLFonly) &&
64 + test -n "$CRLFonlydiff"
65 '
66
67 test_expect_success 'eol=crlf gives a normalized file CRLFs with autocrlf=false' '
68
69 - rm -f .gitattributes tmp one two three &&
69 + rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
70 git config core.autocrlf false &&
71 - echo "one eol=crlf" > .gitattributes &&
71 + echo "LFonly eol=crlf" > .gitattributes &&
72 git read-tree --reset -u HEAD &&
73
74 - has_cr one &&
75 - onediff=$(git diff one) &&
76 - test -z "$onediff"
74 + has_cr LFonly &&
75 + LFonlydiff=$(git diff LFonly) &&
76 + test -z "$LFonlydiff"
77 '
78
79 test_expect_success 'eol=crlf gives a normalized file CRLFs with autocrlf=input' '
80
81 - rm -f .gitattributes tmp one two three &&
81 + rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
82 git config core.autocrlf input &&
83 - echo "one eol=crlf" > .gitattributes &&
83 + echo "LFonly eol=crlf" > .gitattributes &&
84 git read-tree --reset -u HEAD &&
85
86 - has_cr one &&
87 - onediff=$(git diff one) &&
88 - test -z "$onediff"
86 + has_cr LFonly &&
87 + LFonlydiff=$(git diff LFonly) &&
88 + test -z "$LFonlydiff"
89 '
90
91 test_expect_success 'eol=lf gives a normalized file LFs with autocrlf=true' '
92
93 - rm -f .gitattributes tmp one two three &&
93 + rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
94 git config core.autocrlf true &&
95 - echo "one eol=lf" > .gitattributes &&
95 + echo "LFonly eol=lf" > .gitattributes &&
96 git read-tree --reset -u HEAD &&
97
98 - ! has_cr one &&
99 - onediff=$(git diff one) &&
100 - test -z "$onediff"
98 + ! has_cr LFonly &&
99 + LFonlydiff=$(git diff LFonly) &&
100 + test -z "$LFonlydiff"
101 '
102
103 test_expect_success 'autocrlf=true does not normalize CRLF files' '
104
105 - rm -f .gitattributes tmp one two three &&
105 + rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
106 git config core.autocrlf true &&
107 git read-tree --reset -u HEAD &&
108
109 - has_cr one &&
110 - has_cr two &&
111 - onediff=$(git diff one) &&
112 - twodiff=$(git diff two) &&
113 - threediff=$(git diff three) &&
114 - test -z "$onediff" && test -z "$twodiff" && test -z "$threediff"
109 + has_cr LFonly &&
110 + has_cr CRLFonly &&
111 + LFonlydiff=$(git diff LFonly) &&
112 + CRLFonlydiff=$(git diff CRLFonly) &&
113 + LFwithNULdiff=$(git diff LFwithNUL) &&
114 + test -z "$LFonlydiff" -a -z "$CRLFonlydiff" -a -z "$LFwithNULdiff"
115 '
116
117 test_expect_success 'text=auto, autocrlf=true _does_ normalize CRLF files' '
118
119 - rm -f .gitattributes tmp one two three &&
119 + rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
120 git config core.autocrlf true &&
121 echo "* text=auto" > .gitattributes &&
122 git read-tree --reset -u HEAD &&
123
124 - has_cr one &&
125 - has_cr two &&
126 - onediff=$(git diff one) &&
127 - twodiff=$(git diff two) &&
128 - threediff=$(git diff three) &&
129 - test -z "$onediff" && test -n "$twodiff" && test -z "$threediff"
124 + has_cr LFonly &&
125 + has_cr CRLFonly &&
126 + LFonlydiff=$(git diff LFonly) &&
127 + CRLFonlydiff=$(git diff CRLFonly) &&
128 + LFwithNULdiff=$(git diff LFwithNUL) &&
129 + test -z "$LFonlydiff" -a -n "$CRLFonlydiff" -a -z "$LFwithNULdiff"
130 '
131
132 test_expect_success 'text=auto, autocrlf=true does not normalize binary files' '
133
134 - rm -f .gitattributes tmp one two three &&
134 + rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
135 git config core.autocrlf true &&
136 echo "* text=auto" > .gitattributes &&
137 git read-tree --reset -u HEAD &&
138
139 - ! has_cr three &&
140 - threediff=$(git diff three) &&
141 - test -z "$threediff"
139 + ! has_cr LFwithNUL &&
140 + LFwithNULdiff=$(git diff LFwithNUL) &&
141 + test -z "$LFwithNULdiff"
142 '
143
144 test_expect_success 'eol=crlf _does_ normalize binary files' '
145
146 - rm -f .gitattributes tmp one two three &&
147 - echo "three eol=crlf" > .gitattributes &&
146 + rm -f .gitattributes tmp LFonly CRLFonly LFwithNUL &&
147 + echo "LFwithNUL eol=crlf" > .gitattributes &&
148 git read-tree --reset -u HEAD &&
149
150 - has_cr three &&
151 - threediff=$(git diff three) &&
152 - test -z "$threediff"
150 + has_cr LFwithNUL &&
151 + LFwithNULdiff=$(git diff LFwithNUL) &&
152 + test -z "$LFwithNULdiff"
153 '
154
155 test_done