t6300: make UTC and local dates different
By setting the UTC time to 23:18:43 the date in +0200 is the following day, 2006-07-04. This will ensure that the test for "short-local" to be added in the following patch tests for different output from the "short" format. Signed-off-by: John Keeping <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
John Keeping committed
Sep 3, 2015 at 22:49 UTC
db7bae25ed8e80a7afad9a6a9240819528c5192c
1 file changed
+35
-35
t/t6300-for-each-ref.sh
+35
-35
@@ -8,8 +8,8 @@ test_description='for-each-ref test'
8
. ./test-lib.sh
9
. "$TEST_DIRECTORY"/lib-gpg.sh
10
11
-# Mon Jul 3 15:18:43 2006 +0000
12
-datestamp=1151939923
11
+# Mon Jul 3 23:18:43 2006 +0000
12
+datestamp=1151968723
13
setdate_and_increment () {
14
GIT_COMMITTER_DATE="$datestamp +0200"
15
datestamp=$(expr "$datestamp" + 1)
@@ -61,21 +61,21 @@ test_atom head object ''
61
test_atom head type ''
62
test_atom head '*objectname' ''
63
test_atom head '*objecttype' ''
64
-test_atom head author 'A U Thor <author@example.com> 1151939924 +0200'
64
+test_atom head author 'A U Thor <author@example.com> 1151968724 +0200'
65
test_atom head authorname 'A U Thor'
66
test_atom head authoremail '<author@example.com>'
67
-test_atom head authordate 'Mon Jul 3 17:18:44 2006 +0200'
68
-test_atom head committer 'C O Mitter <committer@example.com> 1151939923 +0200'
67
+test_atom head authordate 'Tue Jul 4 01:18:44 2006 +0200'
68
+test_atom head committer 'C O Mitter <committer@example.com> 1151968723 +0200'
69
test_atom head committername 'C O Mitter'
70
test_atom head committeremail '<committer@example.com>'
71
-test_atom head committerdate 'Mon Jul 3 17:18:43 2006 +0200'
71
+test_atom head committerdate 'Tue Jul 4 01:18:43 2006 +0200'
72
test_atom head tag ''
73
test_atom head tagger ''
74
test_atom head taggername ''
75
test_atom head taggeremail ''
76
test_atom head taggerdate ''
77
-test_atom head creator 'C O Mitter <committer@example.com> 1151939923 +0200'
78
-test_atom head creatordate 'Mon Jul 3 17:18:43 2006 +0200'
77
+test_atom head creator 'C O Mitter <committer@example.com> 1151968723 +0200'
78
+test_atom head creatordate 'Tue Jul 4 01:18:43 2006 +0200'
79
test_atom head subject 'Initial'
80
test_atom head contents:subject 'Initial'
81
test_atom head body ''
@@ -96,7 +96,7 @@ test_atom tag parent ''
96
test_atom tag numparent ''
97
test_atom tag object $(git rev-parse refs/tags/testtag^0)
98
test_atom tag type 'commit'
99
-test_atom tag '*objectname' '67a36f10722846e891fbada1ba48ed035de75581'
99
+test_atom tag '*objectname' 'ea122842f48be4afb2d1fc6a4b96c05885ab7463'
100
test_atom tag '*objecttype' 'commit'
101
test_atom tag author ''
102
test_atom tag authorname ''
@@ -107,18 +107,18 @@ test_atom tag committername ''
107
test_atom tag committeremail ''
108
test_atom tag committerdate ''
109
test_atom tag tag 'testtag'
110
-test_atom tag tagger 'C O Mitter <committer@example.com> 1151939925 +0200'
110
+test_atom tag tagger 'C O Mitter <committer@example.com> 1151968725 +0200'
111
test_atom tag taggername 'C O Mitter'
112
test_atom tag taggeremail '<committer@example.com>'
113
-test_atom tag taggerdate 'Mon Jul 3 17:18:45 2006 +0200'
114
-test_atom tag creator 'C O Mitter <committer@example.com> 1151939925 +0200'
115
-test_atom tag creatordate 'Mon Jul 3 17:18:45 2006 +0200'
116
-test_atom tag subject 'Tagging at 1151939927'
117
-test_atom tag contents:subject 'Tagging at 1151939927'
113
+test_atom tag taggerdate 'Tue Jul 4 01:18:45 2006 +0200'
114
+test_atom tag creator 'C O Mitter <committer@example.com> 1151968725 +0200'
115
+test_atom tag creatordate 'Tue Jul 4 01:18:45 2006 +0200'
116
+test_atom tag subject 'Tagging at 1151968727'
117
+test_atom tag contents:subject 'Tagging at 1151968727'
118
test_atom tag body ''
119
test_atom tag contents:body ''
120
test_atom tag contents:signature ''
121
-test_atom tag contents 'Tagging at 1151939927
121
+test_atom tag contents 'Tagging at 1151968727
122
'
123
test_atom tag HEAD ' '
124
@@ -168,16 +168,16 @@ test_date () {
168
169
test_expect_success 'Check unformatted date fields output' '
170
test_date "" \
171
- "Mon Jul 3 17:18:43 2006 +0200" \
172
- "Mon Jul 3 17:18:44 2006 +0200" \
173
- "Mon Jul 3 17:18:45 2006 +0200"
171
+ "Tue Jul 4 01:18:43 2006 +0200" \
172
+ "Tue Jul 4 01:18:44 2006 +0200" \
173
+ "Tue Jul 4 01:18:45 2006 +0200"
174
'
175
176
test_expect_success 'Check format "default" formatted date fields output' '
177
test_date default \
178
- "Mon Jul 3 17:18:43 2006 +0200" \
179
- "Mon Jul 3 17:18:44 2006 +0200" \
180
- "Mon Jul 3 17:18:45 2006 +0200"
178
+ "Tue Jul 4 01:18:43 2006 +0200" \
179
+ "Tue Jul 4 01:18:44 2006 +0200" \
180
+ "Tue Jul 4 01:18:45 2006 +0200"
181
'
182
183
# Don't know how to do relative check because I can't know when this script
@@ -191,36 +191,36 @@ test_expect_success 'Check format "relative" date fields output' '
191
'
192
193
test_expect_success 'Check format "short" date fields output' '
194
- test_date short 2006-07-03 2006-07-03 2006-07-03
194
+ test_date short 2006-07-04 2006-07-04 2006-07-04
195
'
196
197
test_expect_success 'Check format "local" date fields output' '
198
test_date local \
199
- "Mon Jul 3 15:18:43 2006" \
200
- "Mon Jul 3 15:18:44 2006" \
201
- "Mon Jul 3 15:18:45 2006"
199
+ "Mon Jul 3 23:18:43 2006" \
200
+ "Mon Jul 3 23:18:44 2006" \
201
+ "Mon Jul 3 23:18:45 2006"
202
'
203
204
test_expect_success 'Check format "iso8601" date fields output' '
205
test_date iso8601 \
206
- "2006-07-03 17:18:43 +0200" \
207
- "2006-07-03 17:18:44 +0200" \
208
- "2006-07-03 17:18:45 +0200"
206
+ "2006-07-04 01:18:43 +0200" \
207
+ "2006-07-04 01:18:44 +0200" \
208
+ "2006-07-04 01:18:45 +0200"
209
'
210
211
test_expect_success 'Check format "rfc2822" date fields output' '
212
test_date rfc2822 \
213
- "Mon, 3 Jul 2006 17:18:43 +0200" \
214
- "Mon, 3 Jul 2006 17:18:44 +0200" \
215
- "Mon, 3 Jul 2006 17:18:45 +0200"
213
+ "Tue, 4 Jul 2006 01:18:43 +0200" \
214
+ "Tue, 4 Jul 2006 01:18:44 +0200" \
215
+ "Tue, 4 Jul 2006 01:18:45 +0200"
216
'
217
218
test_expect_success 'Check format "raw" date fields output' '
219
- test_date raw "1151939923 +0200" "1151939924 +0200" "1151939925 +0200"
219
+ test_date raw "1151968723 +0200" "1151968724 +0200" "1151968725 +0200"
220
'
221
222
test_expect_success 'Check format of strftime date fields' '
223
- echo "my date is 2006-07-03" >expected &&
223
+ echo "my date is 2006-07-04" >expected &&
224
git for-each-ref \
225
--format="%(authordate:format:my date is %Y-%m-%d)" \
226
refs/heads >actual &&
@@ -528,8 +528,8 @@ body contents
528
$sig"
529
530
cat >expected <<EOF
531
-$(git rev-parse refs/tags/master) <committer@example.com> refs/tags/master
531
$(git rev-parse refs/tags/bogo) <committer@example.com> refs/tags/bogo
532
+$(git rev-parse refs/tags/master) <committer@example.com> refs/tags/master
533
EOF
534
535
test_expect_success 'Verify sort with multiple keys' '