MCPcopy Create free account
hub / github.com/github/gh-aw / TestFormatExperimentSkipMessage

Function TestFormatExperimentSkipMessage

pkg/cli/audit_report_experiments_test.go:247–284  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

245}
246
247func TestFormatExperimentSkipMessage(t *testing.T) {
248 tests := []struct {
249 name string
250 runID int64
251 experiment string
252 variant string
253 wantSubstr string
254 }{
255 {
256 name: "experiment only message",
257 runID: 12345,
258 experiment: "style",
259 variant: "",
260 wantSubstr: `experiment "style" not assigned`,
261 },
262 {
263 name: "experiment and variant message",
264 runID: 12345,
265 experiment: "style",
266 variant: "concise",
267 wantSubstr: `not assigned variant "concise"`,
268 },
269 {
270 name: "run id is included",
271 runID: 99999,
272 experiment: "caveman",
273 variant: "",
274 wantSubstr: "99999",
275 },
276 }
277
278 for _, tt := range tests {
279 t.Run(tt.name, func(t *testing.T) {
280 got := formatExperimentSkipMessage(tt.runID, tt.experiment, tt.variant)
281 assert.Contains(t, got, tt.wantSubstr, "formatExperimentSkipMessage output mismatch")
282 })
283 }
284}
285
286func TestDeriveLastSelectedVariant(t *testing.T) {
287 tests := []struct {

Callers

nothing calls this directly

Calls 2

RunMethod · 0.45

Tested by

no test coverage detected