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

Function TestMapWeekday

pkg/parser/schedule_time_utils_test.go:12–43  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestMapWeekday(t *testing.T) {
13 tests := []struct {
14 input string
15 expected string
16 }{
17 {"sunday", "0"},
18 {"Sunday", "0"},
19 {"sun", "0"},
20 {"monday", "1"},
21 {"Monday", "1"},
22 {"mon", "1"},
23 {"tuesday", "2"},
24 {"tue", "2"},
25 {"wednesday", "3"},
26 {"wed", "3"},
27 {"thursday", "4"},
28 {"thu", "4"},
29 {"friday", "5"},
30 {"fri", "5"},
31 {"saturday", "6"},
32 {"sat", "6"},
33 {"invalid", ""},
34 {"", ""},
35 }
36
37 for _, tt := range tests {
38 t.Run(tt.input, func(t *testing.T) {
39 result := mapWeekday(tt.input)
40 assert.Equal(t, tt.expected, result, "mapWeekday(%q) should return %q", tt.input, tt.expected)
41 })
42 }
43}
44
45func TestParseTime(t *testing.T) {
46 tests := []struct {

Callers

nothing calls this directly

Calls 2

mapWeekdayFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected