Use modern helpers from Go's testing.T API (#2692)

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
This commit is contained in:
Martin Atkins
2025-04-23 04:48:41 -07:00
committed by GitHub
parent 556ba25638
commit 1b9b5cea79
65 changed files with 670 additions and 1139 deletions

View File

@@ -369,7 +369,7 @@ func TestStateRm_backupExplicit(t *testing.T) {
}
func TestStateRm_noState(t *testing.T) {
testCwd(t)
testCwdTemp(t)
p := testProvider()
ui := new(cli.MockUi)
@@ -393,7 +393,7 @@ func TestStateRm_noState(t *testing.T) {
func TestStateRm_needsInit(t *testing.T) {
td := t.TempDir()
testCopyDir(t, testFixturePath("backend-change"), td)
defer testChdir(t, td)()
t.Chdir(td)
p := testProvider()
ui := new(cli.MockUi)
@@ -421,7 +421,7 @@ func TestStateRm_needsInit(t *testing.T) {
func TestStateRm_backendState(t *testing.T) {
td := t.TempDir()
testCopyDir(t, testFixturePath("backend-unchanged"), td)
defer testChdir(t, td)()
t.Chdir(td)
state := states.BuildState(func(s *states.SyncState) {
s.SetResourceInstanceCurrent(
@@ -504,7 +504,7 @@ func TestStateRm_checkRequiredVersion(t *testing.T) {
// Create a temporary working directory that is empty
td := t.TempDir()
testCopyDir(t, testFixturePath("command-check-required-version"), td)
defer testChdir(t, td)()
t.Chdir(td)
state := states.BuildState(func(s *states.SyncState) {
s.SetResourceInstanceCurrent(