(t *testing.T)
| 181 | } |
| 182 | |
| 183 | func 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 | |
| 207 | func TestIsAllDigits(t *testing.T) { |
| 208 | tests := []struct { |
nothing calls this directly
no test coverage detected