File: sa_test.go

package info (click to toggle)
golang-github-shenwei356-util 0.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 228 kB
  • sloc: makefile: 2
file content (14 lines) | stat: -rw-r--r-- 233 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package sa

import (
	"reflect"
	"testing"
)

func TestSuffixArray(t *testing.T) {
	s := []byte("banana$")
	sa := SuffixArray(s)
	if !reflect.DeepEqual(sa, []int{6, 5, 3, 1, 0, 4, 2}) {
		t.Error("Test failed: TestSuffixArray")
	}
}