tests

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package tests provides helpers for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogRecords

func LogRecords(t *testing.T, recs []*pb.Record)

LogRecords testing helper logs market records, one per line.

func NewBalance

func NewBalance(t *testing.T, y int, m time.Month, cash int64, pp ...fin.Position) fin.Balance

NewBalance testing helper creates a fin.Balance with year, month, cash, and optional positions.

func NewPosition

func NewPosition(t *testing.T, inv, div int64) fin.Position

NewPosition testing helper creates a fin.Position with investments and dividend.

func NewRecord

func NewRecord(t *testing.T, y int32, m time.Month, sp, div, earn, cpi int32) *pb.Record

NewRecord testing helper creates a market record for tests.

func NewTime

func NewTime(t *testing.T, year int, month time.Month) time.Time

NewTime testing helper creates a time with year and month.

Types

type InfoStringer

type InfoStringer report.StrategyInfo

InfoStringer makes report.StrategyInfo printable for tests.

func (InfoStringer) String

func (info InfoStringer) String() string

String implements fmt.Stringer interface.

Jump to

Keyboard shortcuts

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