]> git.giacomolli.uk - onechat/blobdiff - terminal_test.go
Bind external events to permanent agent IDs
[onechat] / terminal_test.go
index c93c46f84644e05a39b7ad424b68fecfeba7a1ac..7f83b575dd42f427994dfc5223f1610ed2de023f 100644 (file)
@@ -47,34 +47,56 @@ func TestEventText(t *testing.T) {
                text  string
        }{
                {
                text  string
        }{
                {
-                       name:  "reply as it is",
-                       event: Event{Kind: "reply", Text: "Done."},
-                       text:  "Done.",
+                       name: "keeps the complete reply text",
+                       event: Event{
+                               Kind: "reply",
+                               Text: "Done.",
+                       },
+                       text: "Done.",
                },
                {
                },
                {
-                       name:  "own user message not shown",
-                       event: Event{Kind: "user", Text: "typed", Source: terminalSource},
-                       text:  "",
+                       name: "hides the current terminal user message",
+                       event: Event{
+                               Kind:   "user",
+                               Text:   "typed",
+                               Source: terminalSource,
+                       },
+                       text: "",
                },
                {
                },
                {
-                       name:  "user message of another source marked",
-                       event: Event{Kind: "user", Text: "from the phone", Source: "telegram"},
-                       text:  "[telegram] from the phone",
+                       name: "marks a user message from another source",
+                       event: Event{
+                               Kind:   "user",
+                               Text:   "from the phone",
+                               Source: "telegram",
+                       },
+                       text: "[telegram] from the phone",
                },
                {
                },
                {
-                       name:  "start of a subagent",
-                       event: Event{Kind: "subagent", Text: "GreenOtter"},
-                       text:  "[GreenOtter] started",
+                       name: "marks the start of a subagent",
+                       event: Event{
+                               Kind: "subagent",
+                               Text: "GreenOtter",
+                       },
+                       text: "[GreenOtter] started",
                },
                {
                },
                {
-                       name:  "report of a subagent whole",
-                       event: Event{Kind: "work", Text: "[GreenOtter]\nThere are 3 files.\n\nFull chat: zoom(\"GreenOtter\")", Source: "GreenOtter", Status: subagentFinished},
-                       text:  "[GreenOtter]\nThere are 3 files.\n\nFull chat: zoom(\"GreenOtter\")",
+                       name: "keeps the complete subagent report",
+                       event: Event{
+                               Kind:   "work",
+                               Text:   "[GreenOtter]\nThere are 3 files.\n\nFull chat: zoom(\"GreenOtter\")",
+                               Source: "GreenOtter",
+                               Status: subagentFinished,
+                       },
+                       text: "[GreenOtter]\nThere are 3 files.\n\nFull chat: zoom(\"GreenOtter\")",
                },
                {
                },
                {
-                       name:  "long result cut",
-                       event: Event{Kind: "echo", Text: strings.Repeat("line\n", 12)},
-                       text:  "[result] " + strings.Repeat("line\n", 9) + "line\n[2 more lines]",
+                       name: "clips a long tool result with its omitted count",
+                       event: Event{
+                               Kind: "echo",
+                               Text: strings.Repeat("line\n", 12),
+                       },
+                       text: "[result] " + strings.Repeat("line\n", 9) + "line\n[2 more lines]",
                },
        }
 
                },
        }