nativemodel_windows_test.go 493 B

123456789101112131415161718192021222324252627
  1. // Copyright (C) 2016 The Protocol Authors.
  2. // +build windows
  3. package protocol
  4. import "testing"
  5. func TestFixupFiles(t *testing.T) {
  6. fs := []FileInfo{
  7. {Name: "ok"}, // This file is OK
  8. {Name: "b<d"}, // The rest should be marked as invalid
  9. {Name: "b?d"},
  10. {Name: "bad "},
  11. }
  12. fixupFiles("default", fs)
  13. if fs[0].IsInvalid() {
  14. t.Error("fs[0] should not be invalid")
  15. }
  16. for i := 1; i < len(fs); i++ {
  17. if !fs[i].IsInvalid() {
  18. t.Errorf("fs[%d] should be invalid", i)
  19. }
  20. }
  21. }