From 34cecfa839356f94fb6e22b97499a93364c394c4 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Tue, 24 Oct 2017 12:25:22 -0700 Subject: [PATCH] command/e2etest: fix incorrect "terraform version" test Two different errors here caused this test to pass even though it was incorrect: the wanted version string was incorrect, but the test for it was also inverted, and so together this made the test pass even though it was actually not testing the output at all. --- command/e2etest/version_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/command/e2etest/version_test.go b/command/e2etest/version_test.go index 57a882c6f..174bf1829 100644 --- a/command/e2etest/version_test.go +++ b/command/e2etest/version_test.go @@ -31,6 +31,8 @@ func TestVersion(t *testing.T) { t.Errorf("unexpected stderr output:\n%s", stderr) } + wantVersion := fmt.Sprintf("Terraform v%s", tfcore.VersionString()) + if !strings.Contains(stdout, wantVersion) { wantVersion := fmt.Sprintf("Terraform %s", tfcore.VersionString()) if strings.Contains(stdout, wantVersion) { t.Errorf("output does not contain our current version %q:\n%s", wantVersion, stdout)