Skip to content

Commit

Permalink
check that outputs are truly created in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
unixpickle committed Aug 13, 2020
1 parent 313dae8 commit 20981f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion audio_writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ func TestAudioWriter(t *testing.T) {
t.Fatal(err)
}
defer os.RemoveAll(dir)
aw, err := NewAudioWriter(filepath.Join(dir, "out.wav"), 44100)
outPath := filepath.Join(dir, "out.wav")
aw, err := NewAudioWriter(outPath, 44100)
if err != nil {
t.Fatal(err)
}
Expand All @@ -32,4 +33,7 @@ func TestAudioWriter(t *testing.T) {
if err := aw.Close(); err != nil {
t.Fatal(err)
}
if _, err := os.Stat(outPath); err != nil {
t.Fatal("stat output file should work but got:", err)
}
}
6 changes: 5 additions & 1 deletion video_writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ func TestVideoWriter(t *testing.T) {
t.Fatal(err)
}
defer os.RemoveAll(dir)
vw, err := NewVideoWriter(filepath.Join(dir, "out.mp4"), 50, 50, 12)
outPath := filepath.Join(dir, "out.mp4")
vw, err := NewVideoWriter(outPath, 50, 50, 12)
if err != nil {
t.Fatal(err)
}
Expand All @@ -31,4 +32,7 @@ func TestVideoWriter(t *testing.T) {
if err := vw.Close(); err != nil {
t.Fatal(err)
}
if _, err := os.Stat(outPath); err != nil {
t.Fatal("stat output file should work but got:", err)
}
}

0 comments on commit 20981f8

Please sign in to comment.