Merge branch 'master' into ally_fix_default_val

This commit is contained in:
Robert Liebowitz
2021-04-24 12:51:41 -04:00
25 changed files with 149 additions and 135 deletions

View File

@@ -2038,3 +2038,15 @@ func TestFlagDefaultValue(t *testing.T) {
}
}
}
func TestTimestampFlagApply_WithDestination(t *testing.T) {
var destination Timestamp
expectedResult, _ := time.Parse(time.RFC3339, "2006-01-02T15:04:05Z")
fl := TimestampFlag{Name: "time", Aliases: []string{"t"}, Layout: time.RFC3339, Destination: &destination}
set := flag.NewFlagSet("test", 0)
_ = fl.Apply(set)
err := set.Parse([]string{"--time", "2006-01-02T15:04:05Z"})
expect(t, err, nil)
expect(t, *fl.Destination.timestamp, expectedResult)
}