test

package
v0.0.0-...-f4023ce Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: BSD-3-Clause, CC-BY-4.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckComment

func CheckComment(wantComment, got string) error

CheckComment checks the validity of a txtar comment. It checks that the "got" comment is the same as would be generated by WriteTxtar(..., wantComment), but allows any copyright year.

For testing.

func FindFile

func FindFile(ar *txtar.Archive, filename string) (*txtar.File, error)

FindFile returns the first "file" with the given filename in the txtar archive, or an error if none is found.

Intended for testing.

func ReadTxtarFS

func ReadTxtarFS(filename string) (fs.FS, error)

func TxtarArchiveToFS

func TxtarArchiveToFS(ar *txtar.Archive) (fs.FS, error)

func VerifyImports

func VerifyImports(t *testing.T, allowed ...string)

VerifyImports verifies that a package only imports from allowed.

func WriteTxtar

func WriteTxtar(filename string, files []txtar.File, comment string) error

Types

This section is empty.