test

package
v1.1.33 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForceOSCloseError

func ForceOSCloseError(errs ...error) (patch *monkey.PatchGuard)

ForceOSCloseError patches *os.File.Close to Close the file then return an error. Removing the patch is up to the caller. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys

func ForceTimeNow

func ForceTimeNow(val time.Time) (patch *monkey.PatchGuard)

ForceTimeNow patches time.Now to return the given value. Removing the patch is up to the caller. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys

func OneShotForceFilePathAbsError

func OneShotForceFilePathAbsError(errs ...error)

OneShotForceFilePathAbsError patches filepath.Abs to return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys

func OneShotForceFilePathGlobError

func OneShotForceFilePathGlobError(errs ...error)

OneShotForceFilePathGlobError patches filepath.Chmod to return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys

func OneShotForceIOCopyError

func OneShotForceIOCopyError(errs ...error)

OneShotForceIOCopyError patches io.Copy to return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys

func OneShotForceOSChmodError

func OneShotForceOSChmodError(errs ...error)

OneShotForceOSChmodError patches os.Chmod to return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys

func OneShotForceOSChtimesError

func OneShotForceOSChtimesError(errs ...error)

OneShotForceOSChtimesError patches os.Chtimesto return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys

func OneShotForceOSCloseError

func OneShotForceOSCloseError(errs ...error)

OneShotForceOSCloseError patches *os.File.Close to Close the file then return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys

func OneShotForceOSCreateError

func OneShotForceOSCreateError(errs ...error)

OneShotForceOSCreateError patches os.Create to return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys

func OneShotForceOSReadAtError

func OneShotForceOSReadAtError(errs ...error)

OneShotForceOSReadAtError patches *os.File.ReadAt to return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys

func OneShotForceOSReadError

func OneShotForceOSReadError(errs ...error)

OneShotForceOSReadError patches *os.File.Read to return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys

func OneShotForceOSReaddirnamesError

func OneShotForceOSReaddirnamesError(errs ...error)

OneShotForceOSReaddirnamesError patches *os.File.Readdirnames to return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys

func OneShotForceOSReadlinkError

func OneShotForceOSReadlinkError(errs ...error)

OneShotForceOSReadlinkError patches os.Readlink to return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys

func OneShotForceOSSyncError

func OneShotForceOSSyncError(errs ...error)

OneShotForceOSSyncError patches *os.File.Sync to Sync the file then return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys

func OneShotForceOSTruncateError

func OneShotForceOSTruncateError(errs ...error)

OneShotForceOSTruncateError patches *os.File.Truncate to return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys

func OneShotForceOSWriteAtError

func OneShotForceOSWriteAtError(errs ...error)

OneShotForceOSWriteAtError patches *os.File.WriteAt to return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys

Types

This section is empty.

Jump to

Keyboard shortcuts

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