1
0
mirror of https://github.com/golang/go synced 2024-11-12 06:30:21 -07:00

archive/tar: add test case for passing nil to FileInfoHeader

R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/44710044
This commit is contained in:
Shawn Smith 2013-12-28 16:14:49 +11:00 committed by Dave Cheney
parent 5499034a71
commit 42cea1a452

View File

@ -36,6 +36,10 @@ func TestFileInfoHeader(t *testing.T) {
if g, e := h.ModTime, fi.ModTime(); !g.Equal(e) {
t.Errorf("ModTime = %v; want %v", g, e)
}
// FileInfoHeader should error when passing nil FileInfo
if _, err := FileInfoHeader(nil, ""); err == nil {
t.Fatalf("Expected error when passing nil to FileInfoHeader")
}
}
func TestFileInfoHeaderDir(t *testing.T) {