Documentation ¶
Index ¶
- func CheckAllOccurrences(t *testing.T, x, p string, occ []int) bool
- func CheckOccurrenceAt(t *testing.T, x, p string, i int) bool
- func CheckSAIndices(t *testing.T, x string, sa []int32) bool
- func CheckSASorted(t *testing.T, x string, sa []int32) bool
- func CheckSuffixArray(t *testing.T, x string, sa []int32) bool
- func FibonacciString(n int) string
- func GenerateRandomTestStrings(min, max int, rng *rand.Rand, callback func(x string))
- func GenerateSingletonTestStrings(min, max int, rng *rand.Rand, callback func(x string))
- func GenerateTestStrings(min, max int, rng *rand.Rand, callback func(x string))
- func GenerateTestStringsAndPatterns(min, max int, rng *rand.Rand, callback func(x, p string))
- func IntArraysEqual(a, b []int) bool
- func IsPrefix(x, y string) bool
- func NewRandomSeed(tb testing.TB) *rand.Rand
- func OccurrenceAt(x, p string, i int) bool
- func PickRandomPrefix(x string, rng *rand.Rand) string
- func PickRandomSubstring(x string, rng *rand.Rand) string
- func PickRandomSuffix(x string, rng *rand.Rand) string
- func RandomStringN(n int, alpha string, rng *rand.Rand) string
- func RandomStringRange(min, max int, alpha string, rng *rand.Rand) string
- func SingletonString(n int, a byte) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAllOccurrences ¶
CheckAllOccurrences Tests if string p occurrs at all indices in occ. Reports an error to t otherwise
func CheckOccurrenceAt ¶
CheckOccurrenceAt tests if string p occurrs at index i in string x and reports an error to t otherwise
func CheckSAIndices ¶
CheckSAIndices checks that the suffix array sa has all the indices in x (plus one for the sentinel if len(sa) == len(x) + 1). Reports an error to t otherwise
func CheckSASorted ¶
CheckSASorted checks if a suffix array sa actually represents the sorted suffix in the string x. Reports errors to t.
func CheckSuffixArray ¶
CheckSuffixArray runs all the consistency checks for suffix array sa over string x, reporting errors to t.
func FibonacciString ¶
FibonacciString returns the n'th Fibonacci string.
func GenerateRandomTestStrings ¶
GenerateRandomTestStrings generates strings of length between min and max and calls callback with them.
func GenerateSingletonTestStrings ¶
GenerateSingletonTestStrings generate singeton strings with length between min and max
func GenerateTestStrings ¶
GenerateTestStrings generates strings of length between min and max and calls callback with them.
func GenerateTestStringsAndPatterns ¶
GenerateTestStringsAndPatterns generates a set of strings (x, p) where x is a string to search in and p is a string to search for.
func IntArraysEqual ¶
IntArraysEqual tests if arrays a and b are equal.
func NewRandomSeed ¶
NewRandomSeed creates a new random number generator
func OccurrenceAt ¶
OccurrenceAt returns if string p occurrs at index i in string x.
func PickRandomPrefix ¶
PickRandomPrefix returns a random prefix of the string x.
func PickRandomSubstring ¶
PickRandomSubstring returns a random substring of the string x.
func PickRandomSuffix ¶
PickRandomSuffix returns a random sufix of the string x.
func RandomStringN ¶
RandomStringN constructs a random string of length in n, over the alphabet alpha.
func RandomStringRange ¶
RandomStringRange constructs a random string of length in [min, max), over the alphabet alpha.
func SingletonString ¶
SingletonString generates a string of length n consisting only of the letter a
Types ¶
This section is empty.