go/src/index/suffixarray/suffixarray_test.go

type testCase

var testCases

// find all occurrences of s in source; report at most n occurrences
func find(src, s string, n int) []int {}

func testLookup(t *testing.T, tc *testCase, x *Index, s string, n int) {}

func testFindAllIndex(t *testing.T, tc *testCase, x *Index, rx *regexp.Regexp, n int) {}

func testLookups(t *testing.T, tc *testCase, x *Index, n int) {}

type index

func (x *index) Len() int           {}

func (x *index) Less(i, j int) bool {}

func (x *index) Swap(i, j int) {}

func (x *index) at(i int) []byte {}

func testConstruction(t *testing.T, tc *testCase, x *Index) {}

func equal(x, y *Index) bool {}

// returns the serialized index size
func testSaveRestore(t *testing.T, tc *testCase, x *Index) int {}

func testIndex(t *testing.T) {}

func TestIndex32(t *testing.T) {}

func TestIndex64(t *testing.T) {}

func TestNew32(t *testing.T) {}

func TestNew64(t *testing.T) {}

// test tests an arbitrary suffix array construction function.
// Generates many inputs, builds and checks suffix arrays.
func test(t *testing.T, build func([]byte) []int) {}

// testRec fills x[i:] with all possible combinations of values in [1,max]
// and then calls testSA(t, x, build) for each one.
func testRec(t *testing.T, x []byte, i, max int, numFail *int, build func([]byte) []int) {}

// testSA tests the suffix array build function on the input x.
// It constructs the suffix array and then checks that it is correct.
func testSA(t *testing.T, x []byte, build func([]byte) []int) bool {}

var benchdata

var benchrand

// Of all possible inputs, the random bytes have the least amount of substring
// repetition, and the repeated bytes have the most. For most algorithms,
// the running time of every input will be between these two.
func benchmarkNew(b *testing.B, random bool) {}

func makeText(name string) ([]byte, error) {}

func setBits(bits int) (cleanup func()) {}

func BenchmarkNew(b *testing.B) {}

func BenchmarkSaveRestore(b *testing.B) {}