You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

vendor_test.go 910B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright 2021 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package analyze
  4. import "testing"
  5. func TestIsVendor(t *testing.T) {
  6. tests := []struct {
  7. path string
  8. want bool
  9. }{
  10. {"cache/", true},
  11. {"random/cache/", true},
  12. {"cache", false},
  13. {"dependencies/", true},
  14. {"Dependencies/", true},
  15. {"dependency/", false},
  16. {"dist/", true},
  17. {"dist", false},
  18. {"random/dist/", true},
  19. {"random/dist", false},
  20. {"deps/", true},
  21. {"configure", true},
  22. {"a/configure", true},
  23. {"config.guess", true},
  24. {"config.guess/", false},
  25. {".vscode/", true},
  26. {"doc/_build/", true},
  27. {"a/docs/_build/", true},
  28. {"a/dasdocs/_build-vsdoc.js", true},
  29. {"a/dasdocs/_build-vsdoc.j", false},
  30. }
  31. for _, tt := range tests {
  32. t.Run(tt.path, func(t *testing.T) {
  33. if got := IsVendor(tt.path); got != tt.want {
  34. t.Errorf("IsVendor() = %v, want %v", got, tt.want)
  35. }
  36. })
  37. }
  38. }