mirror of
https://github.com/luxfi/vm.git
synced 2026-10-30 15:13:40 +00:00
35 lines
589 B
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)
|
|
}
|