testutil

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package testutil holds small, dependency-free helpers shared by Go tests across packages. It is imported only from *_test.go files, never from production code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FutureRFC3339

func FutureRFC3339(hours int) string

FutureRFC3339 returns an RFC3339 (UTC) timestamp `hours` from now, mirroring the TypeScript aheadByHours (ui/src/app/lib/test-clock.ts). Use it instead of a literal calendar date in a fixture, which goes stale once the wall clock catches up to it. Negative hours give an already-expired timestamp.

A fixture meant to read as "live" (not merely unexpired) needs to clear both modelAccessExpiringWindow (24h) and the AWS SSO refresh skew, or grading logic will call it "expiring" — 24*30 is what this codebase uses for that case.

func Spellings added in v0.8.6

func Spellings(s string) []string

Spellings is every way stored bytes could spell s that a reader undoes with no key: s itself, its hex in either case, and its base64 in either alphabet, padded or not, at each of the three byte alignments it could start on. The characters the bytes before and after s reach into are cut off, so a match is s's own bytes whatever surrounds them. Use it to assert that something is NOT stored: a test that looks only for s misses s base64-encoded.

Types

This section is empty.

Jump to

Keyboard shortcuts

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