be_time

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Approx

func Approx(compareTo time.Time, threshold time.Duration) types.BeMatcher

Approx succeeds if actual time is approximately equal to the specified time `compareTo` within the given time duration threshold.

func EarlierThan

func EarlierThan(compareTo time.Time) types.BeMatcher

EarlierThan succeeds if actual time is earlier than the specified time `compareTo`.

func EarlierThanEqual

func EarlierThanEqual(compareTo time.Time) types.BeMatcher

EarlierThanEqual succeeds if actual time is earlier than or equal to the specified time `compareTo`.

func IsDST

func IsDST(compareTo time.Time) types.BeMatcher

IsDST checks if actual time is DST

func LaterThan

func LaterThan(compareTo time.Time) types.BeMatcher

LaterThan succeeds if actual time is later than the specified time `compareTo`.

func LaterThanEqual

func LaterThanEqual(compareTo time.Time) types.BeMatcher

LaterThanEqual succeeds if actual time is later than or equal to the specified time `compareTo`.

func SameDay

func SameDay(compareTo time.Time) types.BeMatcher

SameDay succeeds if the day component of the actual time is equal to the day component of the specified time `compareTo`.

func SameHour

func SameHour(compareTo time.Time) types.BeMatcher

SameHour succeeds if actual time is approximately equal to the specified time `compareTo` with the precision of one hour.

func SameMinute

func SameMinute(compareTo time.Time) types.BeMatcher

SameMinute succeeds if actual time is approximately equal to the specified time `compareTo` with the precision of one minute.

func SameMonth

func SameMonth(compareTo time.Time) types.BeMatcher

SameMonth succeeds if the month component of the actual time is equal to the month component of the specified time `compareTo`.

func SameNano

func SameNano(compareTo time.Time) types.BeMatcher

SameNano succeeds if actual time is approximately equal to the specified time `compareTo` with the precision of one nanosecond.

func SameOffset

func SameOffset(compareTo time.Time) types.BeMatcher

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

func SameSecond(compareTo time.Time) types.BeMatcher

SameSecond succeeds if actual time is approximately equal to the specified time `compareTo` with the precision of one second.

func SameTimezone

func SameTimezone(compareTo time.Time) types.BeMatcher

SameTimezone checks if actual time is the same timezone as specified time `compareTo`

func SameWeek

func SameWeek(compareTo time.Time) types.BeMatcher

SameWeek succeeds if the ISO week and year components of the actual time are equal to the ISO week and year components of the specified time `compareTo`.

func SameWeekday

func SameWeekday(compareTo time.Time) types.BeMatcher

SameWeekday succeeds if the weekday component of the actual time is equal to the weekday component of the specified time `compareTo`.

func SameYear

func SameYear(compareTo time.Time) types.BeMatcher

SameYear succeeds if the year component of the actual time is equal to the year component of the specified time `compareTo`.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL