This commit is contained in:
2026-09-02 01:00:09 +03:00
parent 166744fe88
commit eaa46e7494
17 changed files with 1351 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
package mic
import (
"bytes"
"testing"
)
func TestAppendChunkPCMCaps(t *testing.T) {
t.Parallel()
half := maxChunkPCM / 2
buf := appendChunkPCM(nil, bytes.Repeat([]byte{1}, half))
buf = appendChunkPCM(buf, bytes.Repeat([]byte{2}, half))
buf = appendChunkPCM(buf, bytes.Repeat([]byte{3}, half))
if len(buf) != maxChunkPCM {
t.Fatalf("len = %d, want %d", len(buf), maxChunkPCM)
}
if buf[0] != 2 {
t.Fatalf("first byte = %d, want 2 (oldest chunk dropped)", buf[0])
}
}