plans/planfile: fix TestRoundtrip

This was broken by an earlier change to verify the Terraform version
number when reading a state file. To fix it, we'll use our current version
in our constructed file which should then match when it's read back in.
This commit is contained in:
Martin Atkins 2018-11-16 18:16:06 -08:00
parent 6cb3b0f4cf
commit 300eceeb25
1 changed files with 2 additions and 2 deletions

View File

@ -7,12 +7,12 @@ import (
"testing"
"github.com/davecgh/go-spew/spew"
version "github.com/hashicorp/go-version"
"github.com/hashicorp/terraform/configs/configload"
"github.com/hashicorp/terraform/plans"
"github.com/hashicorp/terraform/states"
"github.com/hashicorp/terraform/states/statefile"
tfversion "github.com/hashicorp/terraform/version"
)
func TestRoundtrip(t *testing.T) {
@ -33,7 +33,7 @@ func TestRoundtrip(t *testing.T) {
// We don't need to test the entire thing because the state file
// serialization is already tested in its own package.
stateFileIn := &statefile.File{
TerraformVersion: version.Must(version.NewVersion("1.0.0")),
TerraformVersion: tfversion.SemVer,
Serial: 1,
Lineage: "abc123",
State: states.NewState(),