Something went wrong. Try again.
A code review TUI that tries to reduce how many red and green squiggles you have to squint at
Something went wrong. Try again.
1234567891011121314151617181920package git
import ( "errors" "testing")
func TestBoundedBufferReportsObservedCommandOutputExtent(t *testing.T) { buffer := newBoundedBuffer(4) if written, err := buffer.Write([]byte("abc")); err != nil || written != 3 { t.Fatalf("first Write() = %d, %v", written, err) } written, err := buffer.Write([]byte("def")) var extentError CommandOutputExtentError if written != 0 || !errors.As(err, &extentError) || extentError.CommandOutputBytes() != 6 || extentError.CommandOutputLimitBytes() != 4 { t.Fatalf("bounded Write() = %d, %v", written, err) }}