2023-03-28 22:48:58 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2020-09-10 13:04:56 +00:00
|
|
|
package testutil
|
|
|
|
|
2023-12-06 17:11:32 +00:00
|
|
|
import (
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
|
|
|
var nilInf TestingTB = nil
|
|
|
|
|
|
|
|
// Assertion that our TestingTB can be passed to
|
|
|
|
var _ require.TestingT = nilInf
|
|
|
|
var _ assert.TestingT = nilInf
|
|
|
|
|
2020-09-10 13:04:56 +00:00
|
|
|
// TestingTB is an interface that describes the implementation of the testing object.
|
|
|
|
// Using an interface that describes testing.TB instead of the actual implementation
|
|
|
|
// makes testutil usable in a wider variety of contexts (e.g. use with ginkgo : https://godoc.org/github.com/onsi/ginkgo#GinkgoT)
|
|
|
|
type TestingTB interface {
|
|
|
|
Cleanup(func())
|
2023-12-06 17:11:32 +00:00
|
|
|
Error(args ...any)
|
|
|
|
Errorf(format string, args ...any)
|
|
|
|
Fail()
|
|
|
|
FailNow()
|
2020-09-10 13:04:56 +00:00
|
|
|
Failed() bool
|
2023-12-06 17:11:32 +00:00
|
|
|
Fatal(args ...any)
|
|
|
|
Fatalf(format string, args ...any)
|
2022-08-08 17:59:35 +00:00
|
|
|
Helper()
|
2023-12-06 17:11:32 +00:00
|
|
|
Log(args ...any)
|
|
|
|
Logf(format string, args ...any)
|
|
|
|
Name() string
|
|
|
|
Setenv(key, value string)
|
|
|
|
TempDir() string
|
2020-09-10 13:04:56 +00:00
|
|
|
}
|