Index | Files

package indextest

import ""

Package indextest contains the unit tests for the indexer so they can be re-used for each specific implementation of the index Storage interface.


Package Files



var (
    PubKey = &test.Blob{Contents: "" /* 450 byte string literal not displayed */}
    KeyID  = "2931A67C26F5ABDA"

func Delete Uses

func Delete(t *testing.T, initIdx func() *index.Index)

func EdgesTo Uses

func EdgesTo(t *testing.T, initIdx func() *index.Index)

func EnumStat Uses

func EnumStat(t *testing.T, initIdx func() *index.Index)

func Files Uses

func Files(t *testing.T, initIdx func() *index.Index)

func Index Uses

func Index(t *testing.T, initIdx func() *index.Index)

func MustNew Uses

func MustNew(t *testing.T, s sorted.KeyValue) *index.Index

MustNew wraps index.New and fails with a Fatal error on t if New returns an error.

func PathsOfSignerTarget Uses

func PathsOfSignerTarget(t *testing.T, initIdx func() *index.Index)

func Reindex Uses

func Reindex(t *testing.T, initIdx func() *index.Index)

func ShowReindexRace Uses

func ShowReindexRace(t *testing.T, initIdx func() *index.Index)

type Fataler Uses

type Fataler interface {
    Fatalf(format string, args ...interface{})

type IndexDeps Uses

type IndexDeps struct {
    Index *index.Index

    BlobSource *test.Fetcher

    // Following three needed for signing:
    PublicKeyFetcher *test.Fetcher
    EntityFetcher    jsonsign.EntityFetcher // fetching decrypted openpgp entities
    SignerBlobRef    blob.Ref

    Fataler // optional means of failing.
    // contains filtered or unexported fields

An IndexDeps is a helper for populating and querying an Index for tests.

func NewIndexDeps Uses

func NewIndexDeps(index *index.Index) *IndexDeps

NewIndexDeps returns an IndexDeps helper for populating and working with the provided index for tests.

func (*IndexDeps) AddAttribute Uses

func (id *IndexDeps) AddAttribute(permaNode blob.Ref, attr, value string) blob.Ref

func (*IndexDeps) DelAttribute Uses

func (id *IndexDeps) DelAttribute(permaNode blob.Ref, attr, value string) blob.Ref

func (*IndexDeps) Delete Uses

func (id *IndexDeps) Delete(target blob.Ref) blob.Ref

func (*IndexDeps) DumpIndex Uses

func (id *IndexDeps) DumpIndex(t *testing.T)

func (*IndexDeps) Get Uses

func (id *IndexDeps) Get(key string) string

func (*IndexDeps) LastTime Uses

func (id *IndexDeps) LastTime() time.Time

LastTime returns the time of the most recent mutation (claim).

func (*IndexDeps) NewPermanode Uses

func (id *IndexDeps) NewPermanode() blob.Ref

NewPermanode creates (& signs) a new permanode and adds it to the index, returning its blobref.

func (*IndexDeps) NewPlannedPermanode Uses

func (id *IndexDeps) NewPlannedPermanode(key string) blob.Ref

NewPlannedPermanode creates (& signs) a new planned permanode and adds it to the index, returning its blobref.

func (*IndexDeps) Set Uses

func (id *IndexDeps) Set(key, value string) error

func (*IndexDeps) SetAttribute Uses

func (id *IndexDeps) SetAttribute(permaNode blob.Ref, attr, value string) blob.Ref

func (*IndexDeps) SetAttribute_NoTimeMove Uses

func (id *IndexDeps) SetAttribute_NoTimeMove(permaNode blob.Ref, attr, value string) blob.Ref

func (*IndexDeps) UploadDir Uses

func (id *IndexDeps) UploadDir(dirName string, children []blob.Ref, modTime time.Time) blob.Ref

If modTime is zero, it's not used.

func (*IndexDeps) UploadFile Uses

func (id *IndexDeps) UploadFile(fileName string, contents string, modTime time.Time) (fileRef, wholeRef blob.Ref)

If modTime is zero, it's not used.

func (*IndexDeps) UploadString Uses

func (id *IndexDeps) UploadString(v string) blob.Ref

Package indextest imports 22 packages (graph). Updated 2019-07-28. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).