File: inf_test.go

package info (click to toggle)
distrobuilder 3.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,468 kB
  • sloc: sh: 204; makefile: 75
file content (31 lines) | stat: -rw-r--r-- 557 bytes parent folder | download | duplicates (2)
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)
			}
		})
	}
}