Skip to content

Commit 0a22a83

Browse files
committed
use UTC for tests to avoid timezone dependence
1 parent 7eefa0f commit 0a22a83

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

diff/diff_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@ import (
77
"reflect"
88
"strings"
99
"testing"
10+
"time"
1011
)
1112

13+
func init() {
14+
time.Local = time.UTC
15+
}
16+
1217
func TestParseHunkNoChunksize(t *testing.T) {
1318
filename := "sample_no_chunksize.diff"
1419
diffData, err := ioutil.ReadFile(filepath.Join("testdata", filename))

diff/testdata/sample_file.diff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
--- oldname 2009-10-11 15:12:20.000000000 -0700
2-
+++ newname 2009-10-11 15:12:30.000000000 -0700
1+
--- oldname 2009-10-11 15:12:20.000000000 +0000
2+
+++ newname 2009-10-11 15:12:30.000000000 +0000
33
@@ -1,3 +1,9 @@
44
+This is an important
55
+notice! It should

diff/testdata/sample_file_extended.diff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
diff --git a/vcs/git_cmd.go b/vcs/git_cmd.go
22
index aa4de15..7c048ab 100644
3-
--- oldname 2009-10-11 15:12:20.000000000 -0700
4-
+++ newname 2009-10-11 15:12:30.000000000 -0700
3+
--- oldname 2009-10-11 15:12:20.000000000 +0000
4+
+++ newname 2009-10-11 15:12:30.000000000 +0000
55
@@ -1,3 +1,9 @@
66
+This is an important
77
+notice! It should

diff/testdata/sample_multi_file.diff

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --ruN a/oldname1 b/newname1
22
old mode 0777
33
new mode 0755
4-
--- oldname1 2009-10-11 15:12:20.000000000 -0700
5-
+++ newname1 2009-10-11 15:12:30.000000000 -0700
4+
--- oldname1 2009-10-11 15:12:20.000000000 +0000
5+
+++ newname1 2009-10-11 15:12:30.000000000 +0000
66
@@ -1,3 +1,9 @@
77
+This is an important
88
+notice! It should
@@ -30,8 +30,8 @@ new mode 0755
3030
-check this dokument. On
3131
+check this document. On
3232
diff --ruN a/oldname2 b/newname2
33-
--- oldname2 2009-10-11 15:12:20.000000000 -0700
34-
+++ newname2 2009-10-11 15:12:30.000000000 -0700
33+
--- oldname2 2009-10-11 15:12:20.000000000 +0000
34+
+++ newname2 2009-10-11 15:12:30.000000000 +0000
3535
@@ -1,3 +1,9 @@
3636
+This is an important
3737
+notice! It should

diff/testdata/sample_multi_file_single.diff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
diff --ruN a/oldname1 b/newname1
2-
--- oldname1 2009-10-11 15:12:20.000000000 -0700
3-
+++ newname1 2009-10-11 15:12:30.000000000 -0700
2+
--- oldname1 2009-10-11 15:12:20.000000000 +0000
3+
+++ newname1 2009-10-11 15:12:30.000000000 +0000
44
@@ -1,3 +1,9 @@
55
+This is an important
66
+notice! It should

0 commit comments

Comments
 (0)