(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func 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 | |
| 45 | func TestParseTime(t *testing.T) { |
| 46 | tests := []struct { |
nothing calls this directly
no test coverage detected