github.com/jurelou/go-magic@v0.0.0-20230518182705-f2995a311800/helper_test.go (about) 1 package magic 2 3 import ( 4 "bytes" 5 "path" 6 ) 7 8 var ( 9 // Directory containing test fixtures, etc. 10 testDirectory = "test" 11 12 // Auxiliary files for use in tests ... 13 fixturesDirectory = path.Clean(path.Join(testDirectory, "fixtures")) 14 15 // Default directory containing files using old-style Magic format. 16 formatDirectory = "old-format" 17 18 // PNG image data, 1634 x 2224, 8-bit/color RGBA, non-interlaced 19 sampleImageFile = path.Clean(path.Join(fixturesDirectory, "gopher.png")) 20 21 // Magic file for testing only ... 22 shellMagicFile = path.Clean(path.Join(fixturesDirectory, "shell.magic")) 23 ) 24 25 func compareStrings(this, other string) bool { 26 if this == "" || other == "" { 27 return false 28 } 29 return bytes.Equal([]byte(this), []byte(other)) 30 }