21 lines
530 B
Go
21 lines
530 B
Go
package audio
|
|
|
|
import "testing"
|
|
|
|
// TestLoadSounds memastikan seluruh aset embedded valid: WAV mono/16-bit/44100
|
|
// dan PCM tidak kosong. Gagal di sini = aset ketimpa atau berubah format.
|
|
func TestLoadSounds(t *testing.T) {
|
|
sounds, err := loadSounds()
|
|
if err != nil {
|
|
t.Fatalf("loadSounds: %v", err)
|
|
}
|
|
if len(sounds) != len(allEvents) {
|
|
t.Fatalf("jumlah suara termuat: %d, harusnya %d", len(sounds), len(allEvents))
|
|
}
|
|
for _, ev := range allEvents {
|
|
if len(sounds[ev]) == 0 {
|
|
t.Errorf("%s: PCM kosong", ev)
|
|
}
|
|
}
|
|
}
|