The logic is shamelessly copy from stretchr/testify/assert with some salt and pepper.
Go >= 1.17
go get go.nhat.io/aferoassert
package mypackage_test
import (
"testing"
"github.com/spf13/afero"
"go.nhat.io/aferoassert"
)
func TestTreeEqual_Success(t *testing.T) {
osFs := afero.NewOsFs()
tree := `
- workflows:
- golangci-lint.yaml
- test.yaml 'perm:"0644"'
`
aferoassert.DirExists(t, osFs, ".github")
aferoassert.YAMLTreeEqual(t, osFs, tree, ".github")
}
If this project help you reduce time to develop, you can give me a cup of coffee :)
or scan this