Files
vm/components/verify/verification_test.go

35 lines
589 B
Go

// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package verify
import (
"errors"
"testing"
"github.com/stretchr/testify/require"
)
var errTest = errors.New("non-nil error")
type testVerifiable struct{ err error }
func (v testVerifiable) Verify() error {
return v.err
}
func TestAllNil(t *testing.T) {
require.NoError(t, All(
testVerifiable{},
testVerifiable{},
))
}
func TestAllError(t *testing.T) {
err := All(
testVerifiable{},
testVerifiable{err: errTest},
)
require.ErrorIs(t, err, errTest)
}