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:
parent
5499034a71
commit
42cea1a452
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user