ormtest

package
v0.0.0-...-2935190 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertNoteReader

func AssertNoteReader(t *testing.T, ctx context.Context, repo orm.Repo, note orm.NoteRev, expectBody []byte)

AssertNoteReader ensures that the body of the note matches the expected body

func InsertTestNotes

func InsertTestNotes(t *testing.T, ctx context.Context, repo orm.Repo, notes []string) []orm.NoteRev

InsertTestNotes allows you to quickly insert notes as a list of strings

Types

type Cleanup

type Cleanup func()

Cleanup should be invoked from a defer statement to cleanup resources

func MockClock

func MockClock() Cleanup

MockClock makes time more deterministic in tests. Each time mockClock is called, the UNIX time is incremented by one second.

func TempTestRepo

func TempTestRepo(t *testing.T) (orm.Repo, Cleanup)

TempTestRepo creates a temporary file to store a new repo for testing Calling the Cleanup function will delete the temp file

Jump to

Keyboard shortcuts

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