Open tone-test output before transmission

This commit is contained in:
Brandon McGinty (chatgpt)
2026-08-09 14:41:01 -04:00
committed by Brandon McGinty
parent d64e5125dd
commit e564bb8583
3 changed files with 22 additions and 7 deletions
+15
View File
@@ -0,0 +1,15 @@
package main
import (
"path/filepath"
"testing"
)
// Regression: tone transmission was started before opening its output file,
// so a creation error left audio transmission running without cleanup.
func TestNewAudioFileSaverReportsUnavailableOutputPath(t *testing.T) {
path := filepath.Join(t.TempDir(), "missing", "tone.pcm")
if saver, err := NewAudioFileSaver(path); err == nil || saver != nil {
t.Fatalf("got saver=%v err=%v", saver, err)
}
}