Skip to content

Commit

Permalink
Open magicmime before magicmime'ing missing file.
Browse files Browse the repository at this point in the history
  • Loading branch information
rakyll committed Dec 9, 2015
1 parent 099d11f commit af58cb0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions magicmime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ func testFile(tb testing.TB, path string, expected string) {
}

func TestMissingFile(t *testing.T) {
if err := Open(MAGIC_MIME_TYPE | MAGIC_SYMLINK | MAGIC_ERROR); err != nil {
t.Fatal(err)
}
defer Close()

_, err := TypeByFile("missingFile.txt")
if err == nil {
t.Error("no error for missing file")
Expand Down

0 comments on commit af58cb0

Please sign in to comment.