diff --git a/internal/terminal/testing.go b/internal/terminal/testing.go new file mode 100644 index 000000000..2830b5d0b --- /dev/null +++ b/internal/terminal/testing.go @@ -0,0 +1,191 @@ +package terminal + +import ( + "fmt" + "io" + "os" + "strings" + "sync" + "testing" +) + +// StreamsForTesting is a helper for test code that is aiming to test functions +// that interact with the input and output streams. +// +// This particular function is for the simple case of a function that only +// produces output: the returned input stream is connected to the system's +// "null device", as if a user had run Terraform with I/O redirection like +//