makeInProgressPart is a small constructor for buffered message_part fixtures used by snapshotBufferLocked / subscribeToStream tests. It builds an in-progress part (committedMessageID == 0) with a recognizable text body so failing assertions can identify which part survived the filter.
(text string)
| 5873 | // recognizable text body so failing assertions can identify which |
| 5874 | // part survived the filter. |
| 5875 | func makeInProgressPart(text string) bufferedStreamPart { |
| 5876 | return bufferedStreamPart{ |
| 5877 | event: codersdk.ChatStreamEvent{ |
| 5878 | Type: codersdk.ChatStreamEventTypeMessagePart, |
| 5879 | MessagePart: &codersdk.ChatStreamMessagePart{ |
| 5880 | Role: codersdk.ChatMessageRoleAssistant, |
| 5881 | Part: codersdk.ChatMessageText(text), |
| 5882 | }, |
| 5883 | }, |
| 5884 | } |
| 5885 | } |
| 5886 | |
| 5887 | // makeCommittedPart builds a part already claimed by the given |
| 5888 | // durable assistant message ID. |
no test coverage detected