mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-28 18:01:01 -06:00
efe754183b
This adds unit tests (that will fail at compile time) if various structs don't implement the right interfaces for locking
29 lines
565 B
Go
29 lines
565 B
Go
package remote
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/hashicorp/terraform/state"
|
|
)
|
|
|
|
func TestState(t *testing.T) {
|
|
s := &State{
|
|
Client: new(InmemClient),
|
|
state: state.TestStateInitial(),
|
|
readState: state.TestStateInitial(),
|
|
}
|
|
if err := s.PersistState(); err != nil {
|
|
t.Fatalf("err: %s", err)
|
|
}
|
|
|
|
state.TestState(t, s)
|
|
}
|
|
|
|
func TestState_impl(t *testing.T) {
|
|
var _ state.StateReader = new(State)
|
|
var _ state.StateWriter = new(State)
|
|
var _ state.StatePersister = new(State)
|
|
var _ state.StateRefresher = new(State)
|
|
var _ state.Locker = new(State)
|
|
}
|