(t *testing.T)
| 3098 | } |
| 3099 | |
| 3100 | func TestTimestampFlagApply_WithDestination(t *testing.T) { |
| 3101 | var destination time.Time |
| 3102 | expectedResult, _ := time.Parse(time.RFC3339, "2006-01-02T15:04:05Z") |
| 3103 | fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{Layouts: []string{time.RFC3339}}, Destination: &destination} |
| 3104 | cmd := &Command{ |
| 3105 | Flags: []Flag{ |
| 3106 | &fl, |
| 3107 | }, |
| 3108 | } |
| 3109 | |
| 3110 | assert.NoError(t, cmd.Run(buildTestContext(t), []string{"", "--time", "2006-01-02T15:04:05Z"})) |
| 3111 | assert.Equal(t, expectedResult, destination) |
| 3112 | } |
| 3113 | |
| 3114 | // Test issue #1254 |
| 3115 | // StringSlice() with UseShortOptionHandling causes duplicated entries, depending on the ordering of the flags |
nothing calls this directly
no test coverage detected