Commit 42cea1a4 authored by Shawn Smith's avatar Shawn Smith Committed by Dave Cheney

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

R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/44710044
parent 5499034a
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment