MCPcopy
hub / github.com/urfave/cli / TestTimestampFlagApply_WithDestination

Function TestTimestampFlagApply_WithDestination

flag_test.go:3100–3112  ·  flag_test.go::TestTimestampFlagApply_WithDestination
(t *testing.T)

Source from the content-addressed store, hash-verified

3098}
3099
3100func 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

Callers

nothing calls this directly

Calls 3

RunMethod · 0.95
buildTestContextFunction · 0.85
ParseMethod · 0.65

Tested by

no test coverage detected