@@ -94,6 +94,9 @@ func TestZipArchiver_FileModified(t *testing.T) {
9494 if ! bytes .Equal (expectedContents , actualContents ) {
9595 t .Fatalf ("zip contents do not match, potentially a modified time issue" )
9696 }
97+
98+ oldestZipSupportedModTime , _ := time .Parse (time .RFC3339 , "1980-01-01T00:00:00+00:00" )
99+ ensureModifiedtimes (t , zipFilePath , oldestZipSupportedModTime )
97100}
98101
99102func TestZipArchiver_Dir (t * testing.T ) {
@@ -153,6 +156,20 @@ func TestZipArchiver_Multiple(t *testing.T) {
153156 ensureContents (t , zipfilepath , content )
154157}
155158
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+
156173func ensureContents (t * testing.T , zipfilepath string , wants map [string ][]byte ) {
157174 t .Helper ()
158175 r , err := zip .OpenReader (zipfilepath )
0 commit comments