github.com/fraugster/parquet-go@v0.12.0/helper_test.go (about)

     1  package goparquet
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  )
     8  
     9  func TestPrefix(t *testing.T) {
    10  	data := []struct {
    11  		P1, p2 string
    12  		C      int
    13  	}{
    14  		{P1: "hello", p2: "goodbye", C: 0},
    15  		{P1: "hello", p2: "hallo", C: 1},
    16  		{P1: "hello", p2: "hello", C: 5},
    17  		{P1: "hellotoyou", p2: "hello", C: 5},
    18  		{P1: "hello", p2: "hellotoyou", C: 5},
    19  	}
    20  
    21  	for _, d := range data {
    22  		assert.Equal(t, d.C, prefix([]byte(d.P1), []byte(d.p2)))
    23  	}
    24  }