Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertDirEqual ¶
AssertDirEqual asserts that each file located under root is byte-for-byte identical with it's test representation.
To update files under test, use:
go test ./... -update
WARNING: Multiple AssertDirEqual should not run in the same go test. If you need to call AssertDirEqual more then once in a test, place each in a subtest:
t.Run("docs", func(t *testing.T) { util.AssertDirEqual(t, baseDocsOutDir) }) t.Run("tree", func(t *testing.T) { util.AssertDirEqual(t, basePackageTreeJSONOutDir) })
func AssertDirsEqual ¶
func AssertDirsEqual(t *testing.T, expected, actual string, options ...OptionAssertDirsEqual)
AssertDirsEqual asserts that each file located under root is byte-for-byte identical with another directory, and that the directory structures match.
If you just want to assert that a directory structure is unchanged or show updates, see AssertDirEqual. AssertDirsEqual is about showing that two already written out directories are equivalent.
Types ¶
type OptionAssertDirsEqual ¶
type OptionAssertDirsEqual func(*optionAssertDirsEqual)
func OptionAssertDirsEqualReplace ¶
func OptionAssertDirsEqualReplace(regex, with string) OptionAssertDirsEqual
Apply a regexp based transformation to both the expected and actual content of each file.