1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
package windows
import (
"os"
"testing"
)
func TestMatchClassGuid(t *testing.T) {
tcs := []struct {
filename string
want string
}{
{"testdata/inf01.txt", "{4D36E97B-E325-11CE-BFC1-08002BE10318}"},
{"testdata/inf02.txt", "{4D36E97B-E325-11CE-BFC1-08002BE10318}"},
{"testdata/inf03.txt", ""},
}
for _, tc := range tcs {
t.Run("", func(t *testing.T) {
file, err := os.Open(tc.filename)
if err != nil {
t.Fatal(err)
}
actual := MatchClassGuid(file)
if actual != tc.want {
t.Fatal(actual, tc.want)
}
})
}
}
|