]> git.giacomolli.uk - onechat/blobdiff - replay_test.go
Name and order the agent and config code
[onechat] / replay_test.go
index 32ffebe0778acaca6732a5a05ac5d48821bdd0ff..a19ea9e8ba6646900bf72c230dc8528afb75c623 100644 (file)
@@ -34,7 +34,7 @@ func TestReplaySyntheticLog(t *testing.T) {
        }()
 
        batches := 0
        }()
 
        batches := 0
-       low := chatHigh
+       low := viewChatHigh
        long := make([]bool, syntheticMessages)
        for id := range syntheticMessages {
                if id == syntheticMessages/2 {
        long := make([]bool, syntheticMessages)
        for id := range syntheticMessages {
                if id == syntheticMessages/2 {
@@ -118,12 +118,12 @@ func requireViews(t *testing.T, memory *Memory, lines int, long []bool, full boo
        defer memory.mutex.Unlock()
 
        size := appendSize(memory.chat)
        defer memory.mutex.Unlock()
 
        size := appendSize(memory.chat)
-       require.LessOrEqual(t, size, chatHigh)
-       require.LessOrEqual(t, appendSize(memory.cview), compactionHigh)
+       require.LessOrEqual(t, size, viewChatHigh)
+       require.LessOrEqual(t, appendSize(memory.cview), viewCompactionHigh)
 
        merged := len(memory.chat.lines) < lines
        if merged {
 
        merged := len(memory.chat.lines) < lines
        if merged {
-               require.LessOrEqual(t, size, chatLow)
+               require.LessOrEqual(t, size, viewChatLow)
        }
 
        requireOnlySummaries(t, memory, long, full)
        }
 
        requireOnlySummaries(t, memory, long, full)
@@ -151,7 +151,7 @@ func requireOnlySummaries(t *testing.T, memory *Memory, long []bool, full bool)
 
                if !built {
                        require.Equal(t, 0, line.level)
 
                if !built {
                        require.Equal(t, 0, line.level)
-                       require.Equal(t, head+pending, rendered[n+1])
+                       require.Equal(t, head+viewPending, rendered[n+1])
 
                        continue
                }
 
                        continue
                }
@@ -166,7 +166,7 @@ func requireOnlySummaries(t *testing.T, memory *Memory, long []bool, full bool)
 // appendSize returns the size of view with its last line as the pending mark.
 func appendSize(view *View) int {
        last := view.lines[len(view.lines)-1]
 // appendSize returns the size of view with its last line as the pending mark.
 func appendSize(view *View) int {
        last := view.lines[len(view.lines)-1]
-       return view.Size() - view.lineSize(last) + len(pending)
+       return view.Size() - view.lineSize(last) + len(viewPending)
 }
 
 // viewLines returns the number of lines in the chat view of memory.
 }
 
 // viewLines returns the number of lines in the chat view of memory.