go-testutils

module
v0.0.2024030337 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: MIT

README

Go-testutils

Go-testutils is a collection of utilities for testing. Missing features in os.*, "github.com/stretchr/testify/assert".

fs package

See it in action:

package main

import (
	testfsutils "github.com/knaka/go-testutils/fs"
)

func TestSomething(t *testing.T) {
	err := testfsutils.CopyDir("dest/dir", "src/dir")
}

fsassert package

See it in action:

package main

import (
	"github.com/knaka/go-testutils/fsassert"
)

func TestSomething(t *testing.T) {
	fsassert.FilesAreEqual(t, "testdata/expected.txt", "testdata/actual.txt")
	fsassert.DirsAreEqual(t, "testdata/expected", "testdata/actual"
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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