mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
test: use regex for expected value in TestUiHookPreApply_periodicTimer
(#2035)
Signed-off-by: William Yardley <wyardley@users.noreply.github.com>
This commit is contained in:
parent
0cc4301cd5
commit
00e17ff51c
@ -126,15 +126,15 @@ func TestUiHookPreApply_periodicTimer(t *testing.T) {
|
||||
close(uiState.DoneCh)
|
||||
<-uiState.done
|
||||
|
||||
expectedOutput := `test_instance.foo: Modifying... [id=test]
|
||||
test_instance.foo: Still modifying... [id=test, 1s elapsed]
|
||||
test_instance.foo: Still modifying... [id=test, 2s elapsed]
|
||||
test_instance.foo: Still modifying... [id=test, 3s elapsed]
|
||||
expectedRegexp := `test_instance\.foo: Modifying... \[id=test\]
|
||||
test_instance\.foo: Still modifying... \[id=test, \ds elapsed\]
|
||||
test_instance\.foo: Still modifying... \[id=test, \ds elapsed\]
|
||||
test_instance\.foo: Still modifying... \[id=test, \ds elapsed\]
|
||||
`
|
||||
result := done(t)
|
||||
output := result.Stdout()
|
||||
if output != expectedOutput {
|
||||
t.Fatalf("Output didn't match.\nExpected: %q\nGiven: %q", expectedOutput, output)
|
||||
if matched, _ := regexp.MatchString(expectedRegexp, output); !matched {
|
||||
t.Fatalf("Output didn't match.\nExpected: %q\nGiven: %q", expectedRegexp, output)
|
||||
}
|
||||
|
||||
expectedErrOutput := ""
|
||||
|
Loading…
Reference in New Issue
Block a user