Files
ucan/token/delegation/delegationtest/generator_test.go

27 lines
564 B
Go
Raw Normal View History

package delegationtest
import (
"testing"
"github.com/stretchr/testify/require"
"gotest.tools/v3/golden"
2024-11-20 14:55:48 +01:00
"github.com/ucan-wg/go-ucan/did/didtest"
)
// TestUpdate doesn't actually run a test but uses the Go testing library
// to trigger generation of the delegation tokens and associated Go file.
func TestUpdate(t *testing.T) {
if golden.FlagUpdate() {
update(t)
}
}
func update(t *testing.T) {
t.Helper()
gen := &generator{}
2024-11-20 14:55:48 +01:00
require.NoError(t, gen.chainPersonas(didtest.Personas(), acc{}, noopVariant()))
require.NoError(t, gen.writeGoFile())
}