(t *testing.T)
| 182 | } |
| 183 | |
| 184 | func TestOptionalSecondSchedule(t *testing.T) { |
| 185 | parser := NewParser(SecondOptional | Minute | Hour | Dom | Month | Dow | Descriptor) |
| 186 | entries := []struct { |
| 187 | expr string |
| 188 | expected Schedule |
| 189 | }{ |
| 190 | {"0 5 * * * *", every5min(time.Local)}, |
| 191 | {"5 5 * * * *", every5min5s(time.Local)}, |
| 192 | {"5 * * * *", every5min(time.Local)}, |
| 193 | } |
| 194 | |
| 195 | for _, c := range entries { |
| 196 | actual, err := parser.Parse(c.expr) |
| 197 | if err != nil { |
| 198 | t.Errorf("%s => unexpected error %v", c.expr, err) |
| 199 | } |
| 200 | if !reflect.DeepEqual(actual, c.expected) { |
| 201 | t.Errorf("%s => expected %b, got %b", c.expr, c.expected, actual) |
| 202 | } |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | func TestNormalizeFields(t *testing.T) { |
| 207 | tests := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…