(t *testing.T)
| 3183 | } |
| 3184 | |
| 3185 | func Test_ParseISOTimestamp(t *testing.T) { |
| 3186 | tests := []struct { |
| 3187 | name string |
| 3188 | input string |
| 3189 | expectedErr bool |
| 3190 | expectedTime time.Time |
| 3191 | }{ |
| 3192 | { |
| 3193 | name: "valid RFC3339 format", |
| 3194 | input: "2023-01-15T14:30:00Z", |
| 3195 | expectedErr: false, |
| 3196 | expectedTime: time.Date(2023, 1, 15, 14, 30, 0, 0, time.UTC), |
| 3197 | }, |
| 3198 | { |
| 3199 | name: "valid date only format", |
| 3200 | input: "2023-01-15", |
| 3201 | expectedErr: false, |
| 3202 | expectedTime: time.Date(2023, 1, 15, 0, 0, 0, 0, time.UTC), |
| 3203 | }, |
| 3204 | { |
| 3205 | name: "empty timestamp", |
| 3206 | input: "", |
| 3207 | expectedErr: true, |
| 3208 | }, |
| 3209 | { |
| 3210 | name: "invalid format", |
| 3211 | input: "15/01/2023", |
| 3212 | expectedErr: true, |
| 3213 | }, |
| 3214 | { |
| 3215 | name: "invalid date", |
| 3216 | input: "2023-13-45", |
| 3217 | expectedErr: true, |
| 3218 | }, |
| 3219 | } |
| 3220 | |
| 3221 | for _, tc := range tests { |
| 3222 | t.Run(tc.name, func(t *testing.T) { |
| 3223 | parsedTime, err := parseISOTimestamp(tc.input) |
| 3224 | |
| 3225 | if tc.expectedErr { |
| 3226 | assert.Error(t, err) |
| 3227 | } else { |
| 3228 | assert.NoError(t, err) |
| 3229 | assert.Equal(t, tc.expectedTime, parsedTime) |
| 3230 | } |
| 3231 | }) |
| 3232 | } |
| 3233 | } |
| 3234 | |
| 3235 | func Test_GetIssueComments(t *testing.T) { |
| 3236 | // Verify tool definition once |
nothing calls this directly
no test coverage detected