// TestNotFound tests that we report an error if one tries to declare a sum
// type that isn't defined.
TestNotFound tests that we report an error if one tries to declare a sum
type that isn't defined.
// TestNotFound tests that we report an error if one tries to declare a sum // type that isn ' t defined .
func TestNotFound(t *testing.T) {
	code := `
package main
//go-sumtype:decl T
func main() {}
`
	tmpdir, pkgs := setupPackages(t, code)
	defer teardownPackage(t, tmpdir)
	errs := run(pkgs)
	if !assert.Len(t, errs, 1) {
		t.FailNow()
	}
	assert.Equal(t, "T", errs[0].(notFoundError).Decl.TypeName)
}
func TestNotFound ( t * testing . T ) { code := `
package main

//go-sumtype:decl T

func main() {}
` tmpdir , pkgs := setupPackages ( t , code ) defer teardownPackage ( t , tmpdir ) errs := run ( pkgs ) if ! assert . Len ( t , errs , 1 ) { t . FailNow ( ) } assert . Equal ( t , " " , errs [ 0 ] . ( notFoundError ) . Decl . TypeName ) }
TestNotFound tests that we report an error if one tries to declare a sum
type that isn't defined.
TestNotFound tests that we report an error if one tries to declare a sum type that isn ' t defined .