@@ -94,6 +94,9 @@ func TestZipArchiver_FileModified(t *testing.T) {
94
94
if ! bytes .Equal (expectedContents , actualContents ) {
95
95
t .Fatalf ("zip contents do not match, potentially a modified time issue" )
96
96
}
97
+
98
+ oldestZipSupportedModTime , _ := time .Parse (time .RFC3339 , "1980-01-01T00:00:00+00:00" )
99
+ ensureModifiedtimes (t , zipFilePath , oldestZipSupportedModTime )
97
100
}
98
101
99
102
func TestZipArchiver_Dir (t * testing.T ) {
@@ -153,6 +156,20 @@ func TestZipArchiver_Multiple(t *testing.T) {
153
156
ensureContents (t , zipfilepath , content )
154
157
}
155
158
159
+ func ensureModifiedtimes (t * testing.T , zipfilepath string , modifiedTime time.Time ) {
160
+ r , err := zip .OpenReader (zipfilepath )
161
+ if err != nil {
162
+ t .Fatalf ("could not open zip file: %s" , err )
163
+ }
164
+ defer r .Close ()
165
+
166
+ for _ , cf := range r .File {
167
+ if ! cf .Modified .Equal (modifiedTime ) {
168
+ t .Fatalf ("Modified time does not match, got %s, want %s" , cf .Modified , modifiedTime )
169
+ }
170
+ }
171
+ }
172
+
156
173
func ensureContents (t * testing.T , zipfilepath string , wants map [string ][]byte ) {
157
174
t .Helper ()
158
175
r , err := zip .OpenReader (zipfilepath )
0 commit comments