mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-16 11:42:58 -06:00
ffe056bacb
This is part of a general effort to move all of Terraform's non-library package surface under internal in order to reinforce that these are for internal use within Terraform only. If you were previously importing packages under this prefix into an external codebase, you could pin to an earlier release tag as an interim solution until you've make a plan to achieve the same functionality some other way.
33 lines
899 B
Go
33 lines
899 B
Go
package views
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/hashicorp/terraform/internal/command/arguments"
|
|
"github.com/hashicorp/terraform/internal/moduletest"
|
|
"github.com/hashicorp/terraform/internal/terminal"
|
|
)
|
|
|
|
func TestTest(t *testing.T) {
|
|
streams, close := terminal.StreamsForTesting(t)
|
|
baseView := NewView(streams)
|
|
view := NewTest(baseView, arguments.TestOutput{
|
|
JUnitXMLFile: "",
|
|
})
|
|
|
|
results := map[string]*moduletest.Suite{}
|
|
view.Results(results)
|
|
|
|
output := close(t)
|
|
gotOutput := strings.TrimSpace(output.All())
|
|
wantOutput := `No tests defined. This module doesn't have any test suites to run.`
|
|
if gotOutput != wantOutput {
|
|
t.Errorf("wrong output\ngot:\n%s\nwant:\n%s", gotOutput, wantOutput)
|
|
}
|
|
|
|
// TODO: Test more at this layer. For now, the main UI output tests for
|
|
// the "terraform test" command are in the command package as part of
|
|
// the overall command tests.
|
|
}
|