summaryrefslogtreecommitdiff
path: root/src/pkg/archive/tar/tar_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/archive/tar/tar_test.go')
-rw-r--r--src/pkg/archive/tar/tar_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pkg/archive/tar/tar_test.go b/src/pkg/archive/tar/tar_test.go
index 616a9cc57..ed333f3ea 100644
--- a/src/pkg/archive/tar/tar_test.go
+++ b/src/pkg/archive/tar/tar_test.go
@@ -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) {