testutil

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertGoldenFile

func AssertGoldenFile(t *testing.T, goldenFilePath string, actual []byte) bool

func CalcGoldenFileTestdataDirName

func CalcGoldenFileTestdataDirName() string

func ConfigureTestToCaptureLogs

func ConfigureTestToCaptureLogs(t *testing.T, runCtx *settings.Session, level string) *bytes.Buffer

func ConfigureTestToFailOnLogs

func ConfigureTestToFailOnLogs(t *testing.T, runCtx *settings.Session)

func CreateDirectoryStructure

func CreateDirectoryStructure(t *testing.T, treeOutputLocation string, tmpDir string)

CreateDirectoryStructure reads a tree command output file and creates the directory structure in the specified temp directory.

func FindDirectoriesWithTreeFile

func FindDirectoriesWithTreeFile(t *testing.T, baseDir string) []string

FindDirectoriesWithTreeFile finds and returns a slice of directory paths within the given base directory that contain a "tree.txt" file.

func TestCostComponents

func TestCostComponents(t *testing.T, costComponents []*engine.LineItem, checks []CostComponentCheck)

func TestResources

func TestResources(t *testing.T, resources []*engine.Estimate, checks []ResourceCheck)

Types

type CostCheckFunc

type CostCheckFunc func(*testing.T, *engine.LineItem)

func HourlyPriceMultiplierCheck

func HourlyPriceMultiplierCheck(multiplier decimal.Decimal) CostCheckFunc

func MonthlyPriceMultiplierCheck

func MonthlyPriceMultiplierCheck(multiplier decimal.Decimal) CostCheckFunc

func NilMonthlyCostCheck

func NilMonthlyCostCheck() CostCheckFunc

type CostComponentCheck

type CostComponentCheck struct {
	Name             string
	PriceHash        string
	SkipCheck        bool
	HourlyCostCheck  CostCheckFunc
	MonthlyCostCheck CostCheckFunc
}

type ErrorOnAnyWriter

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

func (ErrorOnAnyWriter) Write

func (e ErrorOnAnyWriter) Write(data []byte) (n int, err error)

type ResourceCheck

type ResourceCheck struct {
	Name                string
	SkipCheck           bool
	CostComponentChecks []CostComponentCheck
	SubResourceChecks   []ResourceCheck
}

Jump to

Keyboard shortcuts

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