Documentation ¶
Overview ¶
Package be_time provides Be matchers on time.Time
Index ¶
- func Approx(compareTo time.Time, threshold time.Duration) types.BeMatcher
- func EarlierThan(compareTo time.Time) types.BeMatcher
- func EarlierThanEqual(compareTo time.Time) types.BeMatcher
- func Eq(compareTo time.Time) types.BeMatcher
- func IsDST(compareTo time.Time) types.BeMatcher
- func LaterThan(compareTo time.Time) types.BeMatcher
- func LaterThanEqual(compareTo time.Time) types.BeMatcher
- func SameDay(compareTo time.Time) types.BeMatcher
- func SameExactDay(compareTo time.Time) types.BeMatcher
- func SameExactHour(compareTo time.Time) types.BeMatcher
- func SameExactMilli(compareTo time.Time) types.BeMatcher
- func SameExactMinute(compareTo time.Time) types.BeMatcher
- func SameExactMonth(compareTo time.Time) types.BeMatcher
- func SameExactSecond(compareTo time.Time) types.BeMatcher
- func SameExactWeek(compareTo time.Time) types.BeMatcher
- func SameExactWeekday(compareTo time.Time) types.BeMatcher
- func SameHour(compareTo time.Time) types.BeMatcher
- func SameMinute(compareTo time.Time) types.BeMatcher
- func SameMonth(compareTo time.Time) types.BeMatcher
- func SameOffset(compareTo time.Time) types.BeMatcher
- func SameSecond(compareTo time.Time) types.BeMatcher
- func SameTimezone(compareTo time.Time) types.BeMatcher
- func SameWeek(compareTo time.Time) types.BeMatcher
- func SameYear(compareTo time.Time) types.BeMatcher
- func SameYearDay(compareTo time.Time) types.BeMatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Approx ¶
Approx succeeds if actual time is approximately equal to the specified time `compareTo` within the given time duration threshold.
func EarlierThan ¶
EarlierThan succeeds if actual time is earlier than the specified time `compareTo`.
func EarlierThanEqual ¶
EarlierThanEqual succeeds if actual time is earlier than or equal to the specified time `compareTo`.
func Eq ¶ added in v0.2.0
Eq succeeds if actual time is equal to the specified time `compareTo` with the precision of one nanosecond.
func LaterThanEqual ¶
LaterThanEqual succeeds if actual time is later than or equal to the specified time `compareTo`.
func SameDay ¶
SameDay checks if the .Day() component of the actual time matches the .Day() component of the specified time `compareTo`. It only verifies the day [1..30(31)], disregarding the month, year, etc.
func SameExactDay ¶ added in v0.2.0
SameExactDay succeeds if the actual time falls within the same day as the specified time `compareTo`.
func SameExactHour ¶ added in v0.2.0
SameExactHour succeeds if the actual time falls within the same hour as the specified time `compareTo`.
func SameExactMilli ¶ added in v0.2.0
SameExactMilli succeeds if the actual time falls within the same millisecond as the specified time `compareTo`.
func SameExactMinute ¶ added in v0.2.0
SameExactMinute succeeds if the actual time falls within the same minute as the specified time `compareTo`.
func SameExactMonth ¶ added in v0.2.0
SameExactMonth succeeds if the actual time falls within the same month as the specified time `compareTo`.
func SameExactSecond ¶ added in v0.2.0
SameExactSecond succeeds if the actual time falls within the same second as the specified time `compareTo`.
func SameExactWeek ¶ added in v0.2.0
SameExactWeek succeeds if the actual time falls within the same ISO week as the specified time `compareTo`.
func SameExactWeekday ¶ added in v0.2.0
SameExactWeekday succeeds if the weekday component of the actual time is equal to the weekday component of the specified time `compareTo`.
func SameHour ¶
SameHour checks if the .Hour() component of the actual time matches the .Hour() component of the specified time `compareTo`. It only verifies the hour [0..59], disregarding other components such as second, minute, day, etc.
func SameMinute ¶
SameMinute checks if the .Minute() component of the actual time matches the .Minute() component of the specified time `compareTo`. It only verifies the minute [0..59], disregarding other components such as second, hour, day, etc.
func SameMonth ¶
SameMonth checks if the .Month() component of the actual time matches the .Month() component of the specified time `compareTo`. It only verifies the month [1..12], disregarding the year.
func SameOffset ¶
SameOffset checks if actual time is the same timezone offset as specified time `compareTo` Note: times can have different timezone names, but same offset, e.g. America/New_York and Canada/Toronto
func SameSecond ¶
SameSecond checks if the .Second() component of the actual time matches the .Second() component of the specified time `compareTo`. It only verifies the second [0..59], disregarding other components such as minute, hour, day, etc.
func SameTimezone ¶
SameTimezone checks if actual time is the same timezone as specified time `compareTo`
func SameWeek ¶
SameWeek succeeds if the ISO week of the actual time are equal to the ISO week and year components of the specified time `compareTo`. It only verifies the week [1..53], disregarding of year. Note: use SameExactWeek to respect exact week of exact year
Types ¶
This section is empty.