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

Function TestTimestampFlagApply_Fail_Parse_Wrong_Time

flag_test.go:2741–2750  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2739}
2740
2741func TestTimestampFlagApply_Fail_Parse_Wrong_Time(t *testing.T) {
2742 fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{Layouts: []string{"Jan 2, 2006 at 3:04pm (MST)"}}}
2743 cmd := &Command{
2744 Flags: []Flag{
2745 &fl,
2746 },
2747 }
2748 err := cmd.Set("time", "2006-01-02T15:04:05Z")
2749 assert.EqualError(t, err, "parsing time \"2006-01-02T15:04:05Z\" as \"Jan 2, 2006 at 3:04pm (MST)\": cannot parse \"2006-01-02T15:04:05Z\" as \"Jan\"")
2750}
2751
2752func TestTimestampFlagApply_Timezoned(t *testing.T) {
2753 pdt := time.FixedZone("PDT", -7*60*60)

Callers

nothing calls this directly

Calls 1

SetMethod · 0.95

Tested by

no test coverage detected