diff --git a/main_test.go b/main_test.go index 23d44b7..7e8f082 100644 --- a/main_test.go +++ b/main_test.go @@ -46,9 +46,14 @@ func TestDriveChange(t *testing.T) { out = strings.ReplaceAll(out, "\n", "") out = strings.ReplaceAll(out, "\r", "") if out != `A>C>C>` { - t.Fatalf("unexpected output '%v'", out) } + + // Reset the text - confirm it is now empty + l.Reset() + if l.GetOutput() != "" { + t.Fatalf("resetting our history didn't work") + } } // TestReadWriteRand invokes our help-samples to read/write @@ -123,4 +128,10 @@ func TestCompleteLighthouse(t *testing.T) { if !strings.Contains(out, "You won") { t.Fatalf("failed to win") } + + // Reset the text - confirm it is now empty + l.Reset() + if l.GetOutput() != "" { + t.Fatalf("resetting our history didn't work") + } }