common

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertContainedLogFile

func AssertContainedLogFile(t *testing.T, dir string, blocks []LogBlock, unique int, duplicates int, contained int)

func AssertDuplicateLogFile

func AssertDuplicateLogFile(t *testing.T, dir string, blocks []LogBlock, unique int, duplicates int)

func AssertExtensionStatsLogFile added in v1.1.1

func AssertExtensionStatsLogFile(t *testing.T, dir string, lines []string)

func AssertFilesExist

func AssertFilesExist(t *testing.T, basePath string, expectedFiles Files)

func AssertIntegrityFile

func AssertIntegrityFile(t *testing.T, dir string, expected []FileHash)

func AssertLogBlocks

func AssertLogBlocks(t *testing.T, lines []string, blocks []LogBlock) (int, int, int)

func AssertLogFileNotExists

func AssertLogFileNotExists(t *testing.T, dir string)

func AssertUpsertLogFile

func AssertUpsertLogFile(t *testing.T, dir string, skipped int, new int, updated int, deleted int)

func AssertVerifyLogFile

func AssertVerifyLogFile(t *testing.T, dir string, valid int, invalid int)

func CreateIntegrityFile

func CreateIntegrityFile(t *testing.T, dir string, fileHashes []FileHash)

func NormalizePath

func NormalizePath(path string) string

Normalizes static test data to fit the os specific notation

func RemoveFile

func RemoveFile(dir string, filename string)

func StaticContent

func StaticContent(sizeInkB int) string

func UpdateFile

func UpdateFile(dir string, filename string, content string, modTime string)

Types

type File

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

func NewFile

func NewFile(relativePath string, modTime string, content string) File

type FileHash

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

func NewFileHash

func NewFileHash(hash string, created string, modTime string, size string, relativePath string) FileHash

type Files

type Files []File

func CreateScenario

func CreateScenario(name string, files Files) (string, Files)

func (*Files) Map

func (f *Files) Map() map[string]File

type LogBlock

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

func NewContainedLogBlock

func NewContainedLogBlock(hash string, relativePaths []string) LogBlock

func NewDuplicateLogBlock

func NewDuplicateLogBlock(hash string, relativePaths []string) LogBlock

Jump to

Keyboard shortcuts

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