(t *testing.T)
| 78 | } |
| 79 | |
| 80 | func TestMultipleBlocklists(t *testing.T) { |
| 81 | if os.Getenv("INTEGRATION_TEST") == "1" { |
| 82 | t.Skip("Skipping multiple blocklists test in integration mode") |
| 83 | } |
| 84 | |
| 85 | output, err := pkgstats(t, []string{"submit", "--dump-json"}, |
| 86 | WithPkgBlocklist([]string{"secret-*", "*-dev"}), |
| 87 | WithMirrorBlocklist([]string{"private.mirror.com", "*.internal.net"}), |
| 88 | WithMirror("http://private.mirror.com/archlinux/$repo/os/$arch"), |
| 89 | ) |
| 90 | if err != nil { |
| 91 | t.Fatalf("Failed to run command: %v", err) |
| 92 | } |
| 93 | |
| 94 | var request submit.Request |
| 95 | if err := json.Unmarshal([]byte(output), &request); err != nil { |
| 96 | t.Fatalf("Failed to unmarshal JSON: %v", err) |
| 97 | } |
| 98 | |
| 99 | if request.Pacman.Mirror != "" { |
| 100 | t.Errorf("Expected pacman mirror to be empty, got %v", request.Pacman.Mirror) |
| 101 | } |
| 102 | if slices.Contains(request.Pacman.Packages, "secret-package") { |
| 103 | t.Errorf("Expected pacman packages to not contain 'secret-package'") |
| 104 | } |
| 105 | if slices.Contains(request.Pacman.Packages, "my-app-dev") { |
| 106 | t.Errorf("Expected pacman packages to not contain 'my-app-dev'") |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | func TestComplexGlobPatterns(t *testing.T) { |
| 111 | if os.Getenv("INTEGRATION_TEST") == "1" { |
nothing calls this directly
no test coverage detected