======================================== Buffer Edge Case Tests ========================================
(t *testing.T)
| 323 | // ======================================== |
| 324 | |
| 325 | func TestBuffer_EdgeCases(t *testing.T) { |
| 326 | t.Run("Empty buffer check", func(t *testing.T) { |
| 327 | b := createNewBuffer() |
| 328 | if b.rowLen != 0 || b.colLen != 0 { |
| 329 | t.Error("New buffer should be empty") |
| 330 | } |
| 331 | }) |
| 332 | |
| 333 | t.Run("Single cell", func(t *testing.T) { |
| 334 | b := createNewBuffer() |
| 335 | _ = b.contAppendSli([]string{"X"}, false) |
| 336 | if b.cont[0][0] != "X" { |
| 337 | t.Error("Single cell failed") |
| 338 | } |
| 339 | }) |
| 340 | |
| 341 | t.Run("Strict mode violation", func(t *testing.T) { |
| 342 | b := createNewBuffer() |
| 343 | _ = b.contAppendSli([]string{"A", "B"}, false) |
| 344 | err := b.contAppendSli([]string{"1", "2", "3"}, true) |
| 345 | if err == nil { |
| 346 | t.Error("Expected error for mismatched columns in strict mode") |
| 347 | } |
| 348 | }) |
| 349 | } |
| 350 | |
| 351 | // ======================================== |
| 352 | // Additional Buffer Tests for Coverage |
nothing calls this directly
no test coverage detected