testutil

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package testutil provides shared test helpers for cronlite.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustParseUUID

func MustParseUUID(s string) uuid.UUID

MustParseUUID parses a UUID string and panics on error. Only for use in tests.

func TestContext

func TestContext(t *testing.T) context.Context

TestContext returns a context with a 5-second timeout. The context is cancelled when the test completes.

Types

type FakeClock

type FakeClock struct {
	// contains filtered or unexported fields
}

FakeClock provides deterministic time for testing.

func NewFakeClock

func NewFakeClock(t time.Time) *FakeClock

NewFakeClock creates a FakeClock set to the given time.

func (*FakeClock) Advance

func (c *FakeClock) Advance(d time.Duration)

Advance moves the clock forward by d.

func (*FakeClock) Now

func (c *FakeClock) Now() time.Time

Now returns the current fake time.

Jump to

Keyboard shortcuts

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