// TestNotSealed tests that we report an error if one tries to declare a sum
// type with an unsealed interface.
TestNotSealed tests that we report an error if one tries to declare a sum
type with an unsealed interface.
// TestNotSealed tests that we report an error if one tries to declare a sum // type with an unsealed interface .
func TestNotSealed(t *testing.T) {
	code := `
package main
//go-sumtype:decl T
type T interface {}
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].(unsealedError).Decl.TypeName)
}
func TestNotSealed ( t * testing . T ) { code := `
package main

//go-sumtype:decl T

type T interface {}

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 ] . ( unsealedError ) . Decl . TypeName ) }
TestNotSealed tests that we report an error if one tries to declare a sum
type with an unsealed interface.
TestNotSealed tests that we report an error if one tries to declare a sum type with an unsealed interface .