testwrite

package
v0.0.0-...-0da26dc Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package testwrite contains functionality to write files for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToDir

func BytesToDir(t *testing.T, b []byte, fileName string) string

BytesToDir writes the given bytes to a file named fileName inside an arbitrary directory and returns the name of the directory. The file and the directory are removed when the test finishes.

func BytesToFile

func BytesToFile(t *testing.T, b []byte) string

BytesToFile writes the given bytes to an arbitrary file and returns the file name. Different invocations return different file names. The file is removed when the test finishes.

func BytesToFileInExistingDir

func BytesToFileInExistingDir(t *testing.T, b []byte, dir string, name string) string

BytesToFileInExistingDir writes the given bytes to a file called name in the given directory and returns the full file name. dir must be an existing directory. The file is removed when the test finishes.

func TempDir

func TempDir(t *testing.T) string

TempDir creates a new directory. Invoking this method multiple times returns different results. The directory and all its contents are removed when the test finishes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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