testutil

package
v0.0.0-...-15a9a0c Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package testutil provides support code for unit tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendToFile

func AppendToFile(path, data string) error

AppendToFile appends data to the file at path.

func ReadFiles

func ReadFiles(dir string) (map[string]string, error)

ReadFiles reads all regular files under dir and returns their relative paths and contents.

func TempDir

func TempDir(t *testing.T) string

TempDir creates a temporary directory prefixed by "tast_unittest_[TestName]." and returns its path. If the directory cannot be created, a fatal error is reported to t.

func WriteFiles

func WriteFiles(dir string, files map[string]string) error

WriteFiles creates and writes files (keys are relative filenames, values are contents) within dir.

Types

This section is empty.

Jump to

Keyboard shortcuts

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