(t *testing.T)
| 2714 | } |
| 2715 | |
| 2716 | func TestTimestampFlagApplyValue(t *testing.T) { |
| 2717 | expectedResult, _ := time.Parse(time.RFC3339, "2006-01-02T15:04:05Z") |
| 2718 | fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{Layouts: []string{time.RFC3339}}, Value: expectedResult} |
| 2719 | cmd := &Command{ |
| 2720 | Flags: []Flag{ |
| 2721 | &fl, |
| 2722 | }, |
| 2723 | } |
| 2724 | |
| 2725 | assert.NoError(t, cmd.Run(buildTestContext(t), []string{""})) |
| 2726 | assert.Equal(t, expectedResult, cmd.Value("time")) |
| 2727 | } |
| 2728 | |
| 2729 | func TestTimestampFlagApply_Fail_Parse_Wrong_Layout(t *testing.T) { |
| 2730 | fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Config: TimestampConfig{Layouts: []string{"randomlayout"}}} |
nothing calls this directly
no test coverage detected