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

Function TestParseSchedule

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

Source from the content-addressed store, hash-verified

10)
11
12func TestParseSchedule(t *testing.T) {
13 tests := []struct {
14 name string
15 input string
16 expectedCron string
17 expectedOrig string
18 shouldError bool
19 errorSubstring string
20 }{
21 // Daily schedules
22 {
23 name: "daily default time",
24 input: "daily",
25 expectedCron: "FUZZY:DAILY * * *",
26 expectedOrig: "daily",
27 },
28 {
29 name: "daily at 02:00",
30 input: "daily at 02:00",
31 shouldError: true,
32 errorSubstring: "'daily at <time>' syntax is not supported",
33 },
34 {
35 name: "daily at midnight",
36 input: "daily at midnight",
37 shouldError: true,
38 errorSubstring: "'daily at <time>' syntax is not supported",
39 },
40 {
41 name: "daily at noon",
42 input: "daily at noon",
43 shouldError: true,
44 errorSubstring: "'daily at <time>' syntax is not supported",
45 },
46 {
47 name: "daily at 3pm",
48 input: "daily at 3pm",
49 shouldError: true,
50 errorSubstring: "'daily at <time>' syntax is not supported",
51 },
52 {
53 name: "daily at 1am",
54 input: "daily at 1am",
55 shouldError: true,
56 errorSubstring: "'daily at <time>' syntax is not supported",
57 },
58 {
59 name: "daily at 12am (midnight)",
60 input: "daily at 12am",
61 shouldError: true,
62 errorSubstring: "'daily at <time>' syntax is not supported",
63 },
64 {
65 name: "daily at 12pm (noon)",
66 input: "daily at 12pm",
67 shouldError: true,
68 errorSubstring: "'daily at <time>' syntax is not supported",
69 },

Callers

nothing calls this directly

Calls 3

ParseScheduleFunction · 0.85
RunMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected