mirror of
https://github.com/vbatts/tar-split.git
synced 2024-12-18 19:46:29 +00:00
Merge pull request #38 from vbatts/travis
travis: test more go versions
This commit is contained in:
commit
b9127a1393
2 changed files with 10 additions and 8 deletions
|
@ -1,8 +1,11 @@
|
||||||
language: go
|
language: go
|
||||||
go:
|
go:
|
||||||
- tip
|
- tip
|
||||||
- 1.6.2
|
- 1.x
|
||||||
- 1.5.4
|
- 1.8.x
|
||||||
|
- 1.7.x
|
||||||
|
- 1.6.x
|
||||||
|
- 1.5.x
|
||||||
|
|
||||||
# let us have pretty, fast Docker-based Travis workers!
|
# let us have pretty, fast Docker-based Travis workers!
|
||||||
sudo: false
|
sudo: false
|
||||||
|
|
|
@ -94,13 +94,12 @@ func TestRoundTrip(t *testing.T) {
|
||||||
var b bytes.Buffer
|
var b bytes.Buffer
|
||||||
tw := NewWriter(&b)
|
tw := NewWriter(&b)
|
||||||
hdr := &Header{
|
hdr := &Header{
|
||||||
Name: "file.txt",
|
Name: "file.txt",
|
||||||
Uid: 1 << 21, // too big for 8 octal digits
|
Uid: 1 << 21, // too big for 8 octal digits
|
||||||
Size: int64(len(data)),
|
Size: int64(len(data)),
|
||||||
ModTime: time.Now(),
|
// https://github.com/golang/go/commit/0e3355903d2ebcf5ee9e76096f51ac9a116a9dbb#diff-d7bf2a98d7b57b6ff754ca406f1b7581R105
|
||||||
|
ModTime: time.Now().AddDate(0, 0, 0).Round(1 * time.Second),
|
||||||
}
|
}
|
||||||
// tar only supports second precision.
|
|
||||||
hdr.ModTime = hdr.ModTime.Add(-time.Duration(hdr.ModTime.Nanosecond()) * time.Nanosecond)
|
|
||||||
if err := tw.WriteHeader(hdr); err != nil {
|
if err := tw.WriteHeader(hdr); err != nil {
|
||||||
t.Fatalf("tw.WriteHeader: %v", err)
|
t.Fatalf("tw.WriteHeader: %v", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue