github.com/abemedia/go-don@v0.2.2-0.20240329015135-be88e32bb73b/internal/byteconv/byteconv_test.go (about)

     1  package byteconv_test
     2  
     3  import (
     4  	"bytes"
     5  	"testing"
     6  
     7  	"github.com/abemedia/go-don/internal/byteconv"
     8  )
     9  
    10  func TestBtoa(t *testing.T) {
    11  	if byteconv.Btoa([]byte("test")) != "test" {
    12  		t.Error("should be equal")
    13  	}
    14  }
    15  
    16  func TestAtob(t *testing.T) {
    17  	if !bytes.Equal(byteconv.Atob("test"), []byte("test")) {
    18  		t.Error("should be equal")
    19  	}
    20  }