MCPcopy Create free account
hub / github.com/buggregator/server / TestResolveProject

Function TestResolveProject

modules/sentry/handler_test.go:183–205  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

181}
182
183func TestResolveProject(t *testing.T) {
184 tests := []struct {
185 segment string
186 want string
187 }{
188 {"1", ""}, // numeric DSN id (Sentry SDK-forced) → default
189 {"123", ""}, // multi-digit numeric → default
190 {"my-app", "my-app"},
191 {"", ""},
192 {"app2", "app2"}, // trailing digit is a named project
193 {"2team", "2team"},
194 {"١٢٣", "١٢٣"}, // Arabic-Indic digits are named, not numeric (ASCII only)
195 {"123", "123"}, // fullwidth digits are named, not numeric
196 }
197
198 for _, tt := range tests {
199 t.Run(tt.segment, func(t *testing.T) {
200 if got := resolveProject(tt.segment); got != tt.want {
201 t.Errorf("resolveProject(%q) = %q, want %q", tt.segment, got, tt.want)
202 }
203 })
204 }
205}
206
207func TestIsAllDigits(t *testing.T) {
208 tests := []struct {

Callers

nothing calls this directly

Calls 2

resolveProjectFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected