okami.mom/albedo
git clone https://git.nkp.pet/okami.mom/albedo
8499f48
main
1// Byte-bound eviction protects long TUI transcripts beyond practical daemon E2E history. 2package tui 3 4import ( 5"strings" 6"testing" 7) 8 9func TestBoundedHistory_ByteLimit (t * testing.T ) { 10h := NewBoundedHistory (100 ,500 ) 11for range 10 { 12h .Append (HistoryEntry { 13Kind :EntryAssistant , 14Text :strings .Repeat ("x" ,100 ), 15 }) 16 } 17 18if h .TotalBytes ()> 500 { 19t .Fatalf ("expected total bytes <= 500, got %d" ,h .TotalBytes ()) 20 } 21if h .EvictedCount ()== 0 { 22t .Fatalf ("expected evictions due to byte limit" ) 23 } 24if h .EvictedBytes ()== 0 { 25t .Fatalf ("expected non-zero evicted bytes" ) 26 } 27}