(t *testing.T)
| 248 | } |
| 249 | |
| 250 | func Test_Send_RejectsWhitespace(t *testing.T) { |
| 251 | tests := []struct { |
| 252 | name string |
| 253 | content string |
| 254 | }{ |
| 255 | {"leading space", " hello"}, |
| 256 | {"trailing space", "hello "}, |
| 257 | {"leading newline", "\nhello"}, |
| 258 | {"trailing newline", "hello\n"}, |
| 259 | {"both sides", " hello "}, |
| 260 | {"newlines both sides", "\nhello\n"}, |
| 261 | {"leading tab", "\thello"}, |
| 262 | {"trailing tab", "hello\t"}, |
| 263 | } |
| 264 | |
| 265 | for _, tt := range tests { |
| 266 | t.Run(tt.name, func(t *testing.T) { |
| 267 | mClock := quartz.NewMock(t) |
| 268 | mock := newMockAgentIO() |
| 269 | conv := acpio.NewACPConversation(context.Background(), mock, nil, nil, nil, mClock) |
| 270 | |
| 271 | err := conv.Send(screentracker.MessagePartText{Content: tt.content}) |
| 272 | |
| 273 | assert.ErrorIs(t, err, screentracker.ErrMessageValidationWhitespace) |
| 274 | }) |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | func Test_Send_RejectsDuplicateSend(t *testing.T) { |
| 279 | mClock := quartz.NewMock(t) |
nothing calls this directly
no test coverage detected