Documentation
¶
Index ¶
- func AllocateFreePort() (int, error)
- func AllocateTwoFreePorts(tb testing.TB) (appPort, ctrlPort int)
- func AssertBucketDistribution(t AssertableT, idsA, idsC, allIDs []string)
- func AssertGtGteGap1(t AssertableT, gteIDs []string, gtIDs []string, boundary string)
- func AssertKeyRangeRunResult(t AssertableT, caseName, label string, wantAsc []string, ids []string, ok bool, ...)
- func AssertLtLteGap1(t AssertableT, lteIDs []string, ltIDs []string, boundary string)
- func AssertScoreEqSKId(t AssertableT, siAsc, skAsc, siDesc, skDesc []string)
- func AssertSearchIndexMatrix(t AssertableT, run SearchIndexRunFn, idxName string, cases []KeyRangeCtorCase, ...)
- func AssertSearchKeyMatrix(t AssertableT, run SearchKeyRunFn, cases []KeyRangeCtorCase, ...)
- func AssertSparseLimit10(t AssertableT, siIDs []string)
- func CountX() int
- func DBPath(tb testing.TB) string
- func KeyRangeDocKeyAttrs() []string
- func KeyRangeDocTTL() time.Duration
- func KeyRangeFixtureMem() bool
- func KeyRangeIndexName(namespace string, mem bool, name string) string
- func KeyRangeKeyPattern(namespace string, mem bool) string
- func KeyRangeRawIndexes(namespace string, mem bool) []x.Index
- func LoadFeature(t *testing.T) string
- func XFirstN(ids []string, n int) []string
- func XIDKey(namespace string, mem bool, id string) string
- func XIDsFromValues(values []string) []string
- func XKeyPrefix(namespace string, mem bool) string
- func XLastN(ids []string, n int) []string
- func XRangeIDs(lo, hi int) []string
- func XReverseIDs(asc []string) []string
- func XStrictMonotonic(ids []string, desc bool) bool
- type AssertableT
- type KV
- type KeyRangeCtorCase
- type SearchIndexRunFn
- type SearchKeyRunFn
- type TestDoc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllocateFreePort ¶ added in v0.1.15
AllocateFreePort picks a free TCP port on 127.0.0.1 by binding to :0 then immediately releasing the socket. Callers should be aware of the inherent TIME_WAIT race on Darwin: re-binding the returned port in the same process within a few milliseconds can occasionally fail with "address already in use" when the kernel hands it to another concurrent goroutine before the original listener's close fully propagates. In practice the 10 ms sleep injected by server.StartWith plus per-port randomization inside Go's `net` package is enough to keep the window tiny.
func AllocateTwoFreePorts ¶ added in v0.1.15
AllocateTwoFreePorts returns two distinct free TCP ports on 127.0.0.1. The two ports are NEVER equal even if a transient listener release leaves an overlap window for the second allocate.
func AssertBucketDistribution ¶ added in v0.1.13
func AssertBucketDistribution(t AssertableT, idsA, idsC, allIDs []string)
func AssertGtGteGap1 ¶ added in v0.1.13
func AssertGtGteGap1(t AssertableT, gteIDs []string, gtIDs []string, boundary string)
func AssertKeyRangeRunResult ¶ added in v0.1.13
func AssertLtLteGap1 ¶ added in v0.1.13
func AssertLtLteGap1(t AssertableT, lteIDs []string, ltIDs []string, boundary string)
func AssertScoreEqSKId ¶ added in v0.1.13
func AssertScoreEqSKId(t AssertableT, siAsc, skAsc, siDesc, skDesc []string)
func AssertSearchIndexMatrix ¶ added in v0.1.13
func AssertSearchIndexMatrix(t AssertableT, run SearchIndexRunFn, idxName string, cases []KeyRangeCtorCase, idFn func(string) string, caseNamePrefix string)
func AssertSearchKeyMatrix ¶ added in v0.1.13
func AssertSearchKeyMatrix(t AssertableT, run SearchKeyRunFn, cases []KeyRangeCtorCase, idFn func(string) string, caseNamePrefix string)
func AssertSparseLimit10 ¶ added in v0.1.13
func AssertSparseLimit10(t AssertableT, siIDs []string)
func KeyRangeDocKeyAttrs ¶ added in v0.1.13
func KeyRangeDocKeyAttrs() []string
func KeyRangeDocTTL ¶ added in v0.1.13
func KeyRangeFixtureMem ¶ added in v0.1.13
func KeyRangeFixtureMem() bool
func KeyRangeIndexName ¶ added in v0.1.13
func KeyRangeKeyPattern ¶ added in v0.1.13
func KeyRangeRawIndexes ¶ added in v0.1.13
func LoadFeature ¶
LoadFeature dynamically loads a JSON file based on the calling test's context. The file name format is: {SuiteName}_{TestMethodName}_{CaseName}.json All spaces in the case name are replaced with underscores. Example: UpdateSuite_TestUpdateCases_Update_existing_property.json
func XIDsFromValues ¶ added in v0.1.13
func XKeyPrefix ¶ added in v0.1.13
func XReverseIDs ¶ added in v0.1.13
func XStrictMonotonic ¶ added in v0.1.13
Types ¶
type AssertableT ¶ added in v0.1.13
type KeyRangeCtorCase ¶ added in v0.1.13
type KeyRangeCtorCase struct {
Name string
Build func(idFn func(string) string) x.KeyRange
WantAsc []string
}
func KeyRangeCtorCases ¶ added in v0.1.13
func KeyRangeCtorCases() []KeyRangeCtorCase