fix: test slowness on usage of exit

This commit is contained in:
2026-03-21 08:01:31 +00:00
parent ff533753ef
commit f50a6b6447
2 changed files with 23 additions and 3 deletions
+15
View File
@@ -20,6 +20,21 @@ func TestLoadRecordedInputTrimsTrailingNewlineAfterEOF(t *testing.T) {
}
}
func TestLoadRecordedInputTrimsTrailingNewlineAfterCarriageReturn(t *testing.T) {
path := filepath.Join(t.TempDir(), "in")
writeFile(t, path, "echo hi\rexit\r\n")
got, err := loadRecordedInput(path)
if err != nil {
t.Fatalf("loadRecordedInput() error = %v", err)
}
want := "echo hi\rexit\r"
if string(got) != want {
t.Fatalf("loadRecordedInput() = %q, want %q", string(got), want)
}
}
func TestLoadRecordedInputLeavesNormalTrailingNewline(t *testing.T) {
path := filepath.Join(t.TempDir(), "in")
writeFile(t, path, "echo hi\n")