testutil

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpectErrContaining

func ExpectErrContaining(t *testing.T, err error, str string)

func ExpectErrIs

func ExpectErrIs(t *testing.T, err error, expected error)

func ExpectPackage

func ExpectPackage(t *testing.T, packages []lockfile.PackageDetails, pkg lockfile.PackageDetails)

func ExpectPackages

func ExpectPackages(t *testing.T, actualPackages []lockfile.PackageDetails, expectedPackages []lockfile.PackageDetails)

func ExpectPackagesWithoutLocations

func ExpectPackagesWithoutLocations(t *testing.T, actualPackages []lockfile.PackageDetails, expectedPackages []lockfile.PackageDetails)

func GetTestContext added in v1.4.0

func GetTestContext() lockfile.ScanContext

func HasPackage

func HasPackage(t *testing.T, expectedPkgs []lockfile.PackageDetails, currentPkg lockfile.PackageDetails, ignoreLocations bool) bool

func InnerExpectPackage

func InnerExpectPackage(t *testing.T, expectedPkgs []lockfile.PackageDetails, currentPkg lockfile.PackageDetails, ignoreLocations bool)

func InnerExpectPackages

func InnerExpectPackages(t *testing.T, actualPackages []lockfile.PackageDetails, expectedPackages []lockfile.PackageDetails, ignoreLocations bool)

func MockAllMatchers

func MockAllMatchers()

func PackageToString

func PackageToString(pkg lockfile.PackageDetails) string

Types

type FailingMatcher

type FailingMatcher struct {
	Error error
}

func (FailingMatcher) GetSourceFile

func (m FailingMatcher) GetSourceFile(f lockfile.DepFile) (lockfile.DepFile, error)

func (FailingMatcher) Match

func (m FailingMatcher) Match(sourceFile lockfile.DepFile, packages []lockfile.PackageDetails, context lockfile.ScanContext) error

type SuccessfulMatcher

type SuccessfulMatcher struct{}

func (SuccessfulMatcher) GetSourceFile

func (m SuccessfulMatcher) GetSourceFile(_ lockfile.DepFile) (lockfile.DepFile, error)

func (SuccessfulMatcher) Match

func (m SuccessfulMatcher) Match(sourceFile lockfile.DepFile, packages []lockfile.PackageDetails, context lockfile.ScanContext) error

Jump to

Keyboard shortcuts

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