//go:build windows package window import "testing" func TestFileFilter(t *testing.T) { raw := fileFilter([]string{"pdf", ".txt"}) s := string(utf16Runes(raw)) want := "*.pdf;*.txt (*.pdf;*.txt)\x00*.pdf;*.txt\x00All files (*.*)\x00*.*\x00\x00\x00" if s != want { t.Errorf("filter = %q, want %q", s, want) } } func utf16Runes(u []uint16) []rune { r := make([]rune, len(u)) for i, c := range u { r[i] = rune(c) } return r }