Skip to content

Commit

Permalink
ci: fix windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andreynering committed Feb 27, 2025
1 parent 3be937e commit 7c32c34
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
1 change: 1 addition & 0 deletions exp/teatest/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func TestApp(t *testing.T) {
}

out := readBts(t, tm.FinalOutput(t, teatest.WithFinalTimeout(time.Second)))
out = bytes.ReplaceAll(out, []byte("\r\n"), []byte("\n"))
if !regexp.MustCompile(`This program will exit in \d+ seconds`).Match(out) {
t.Fatalf("output does not match the given regular expression: %s", string(out))
}
Expand Down
4 changes: 4 additions & 0 deletions exp/teatest/send_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package teatest_test

import (
"bytes"
"fmt"
"strings"
"testing"
Expand Down Expand Up @@ -42,6 +43,9 @@ func TestAppSendToOtherProgram(t *testing.T) {
out1 := readBts(t, tm1.FinalOutput(t, teatest.WithFinalTimeout(time.Second)))
out2 := readBts(t, tm2.FinalOutput(t, teatest.WithFinalTimeout(time.Second)))

out1 = bytes.ReplaceAll(out1, []byte("\r\n"), []byte("\n"))
out2 = bytes.ReplaceAll(out2, []byte("\r\n"), []byte("\n"))

if string(out1) != string(out2) {
t.Errorf("output of both models should be the same, got:\n%v\nand:\n%v\n", string(out1), string(out2))
}
Expand Down
8 changes: 5 additions & 3 deletions exp/teatest/testdata/TestApp.golden
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[?25l[?2004hHi. This program will exit in 10 seconds. To quit sooner press any key
Hi. This program will exit in 9 seconds. To quit sooner press any key.
[?2004l[?25h[?1002l[?1003l[?1006l
[?25l[?2004h
Hi. This program will exit in 10 seconds. To quit sooner press any key
Hi. This program will exit in 9 seconds. To quit sooner press any key.

[?2004l[?25h[?1002l[?1003l[?1006l
16 changes: 9 additions & 7 deletions exp/teatest/testdata/TestAppSendToOtherProgram.golden
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[?25l[?2004hAll pings:
from m1
from m1
from m2
from m2
from m2
from m2[?2004l[?25h[?1002l[?1003l[?1006l
[?25l[?2004h
All pings:
from m1
from m1
from m2
from m2
from m2
from m2
[?2004l[?25h[?1002l[?1003l[?1006l

0 comments on commit 7c32c34

Please sign in to comment.