...

Source file src/gitlab.hexacode.org/go-libs/hctypes/Buffer_test.go

Documentation: gitlab.hexacode.org/go-libs/hctypes

     1  package hctypes_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"gitlab.hexacode.org/go-libs/hctypes"
     7  )
     8  
     9  func TestBufferEqual(t *testing.T) {
    10  	buf1 := hctypes.Buffer{0x01, 0x02, 0x03}
    11  	buf2 := hctypes.Buffer{0x01, 0x02, 0x03}
    12  	buf3 := hctypes.Buffer{0x04, 0x05, 0x06}
    13  
    14  	if !buf1.Equal(buf2) {
    15  		t.Error("Buffers should be equal")
    16  	}
    17  
    18  	if buf1.Equal(buf3) {
    19  		t.Error("Buffers should not be equal")
    20  	}
    21  }
    22  

View as plain text