github.com/ledgerwatch/erigon-lib@v1.0.0/sais/sais_test.go (about)

     1  package sais
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  )
     8  
     9  func TestSais(t *testing.T) {
    10  	data := []byte{4, 5, 6, 4, 5, 6, 4, 5, 6}
    11  	sa := make([]int32, len(data))
    12  	err := Sais(data, sa)
    13  	if err != nil {
    14  		t.Fatal(err)
    15  	}
    16  	assert.Equal(t, []int32{6, 3, 0, 7, 4, 1, 8, 5, 2}, sa)
    17  }