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.
This commit is contained in:
Martin Atkins 2017-10-24 12:25:22 -07:00
parent d33e0f0a58
commit 34cecfa839
1 changed files with 2 additions and 0 deletions

View File

@ -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)