txfiletest

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package txfiletest provides utilities for testing on top of txfile.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupPath

func SetupPath(t testT, file string) (dir string, teardown func())

SetupPath creates a temporary directory for testing. Use the teardown function to remove the directory again.

Types

type TestFile

type TestFile struct {
	*txfile.File

	Path string
	// contains filtered or unexported fields
}

TestFile wraps a txfile.File structure for testing.

func SetupTestFile

func SetupTestFile(t testT, opts txfile.Options) (tf *TestFile, teardown func())

SetupTestFile creates a new testfile in a temporary directory. The teardown function will remove the directory and the temporary file.

func (*TestFile) Close

func (f *TestFile) Close()

Close the test file.

func (*TestFile) Open

func (f *TestFile) Open()

Open opens the file if it has been closed. The File pointer will be changed.

func (*TestFile) Reopen

func (f *TestFile) Reopen()

Reopen tries to close and open the file again.

Jump to

Keyboard shortcuts

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