github.com/ergo-services/ergo@v1.999.224/lib/tools_test.go (about)

     1  package lib
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestBuffer(t *testing.T) {
     8  	b := TakeBuffer()
     9  
    10  	if cap(b.B) != DefaultBufferLength {
    11  		t.Fatal("incorrect capacity")
    12  	}
    13  
    14  	if len(b.B) != 0 {
    15  		t.Fatal("should be zero length")
    16  	}
    17  
    18  }