Documentation
¶
Index ¶
- Variables
- func AssertLoaderSpec(t *testing.T, r dsref.Loader, putFunc PutDatasetFunc)
- func AssertResolverSpec(t *testing.T, r dsref.Resolver, putFunc PutRefFunc)
- func ConsistentResolvers(t *testing.T, ref dsref.Ref, resolvers ...dsref.Resolver) error
- func ForeignLogbook(t *testing.T, username string) *logbook.Book
- func GenerateExampleDataset(ctx context.Context) (*dataset.Dataset, error)
- func GenerateExampleOplog(ctx context.Context, journal *logbook.Book, dsname, headPath string) (string, *oplog.Log, error)
- func InconsistentResolvers(t *testing.T, ref dsref.Ref, a, b dsref.Resolver) error
- type PutDatasetFunc
- type PutRefFunc
Constants ¶
This section is empty.
Variables ¶
var ErrResolversInconsistent = fmt.Errorf("inconsistent resolvers")
ErrResolversInconsistent indicates two resolvers honored a resolution request, but gave differing responses
Functions ¶
func AssertLoaderSpec ¶
func AssertLoaderSpec(t *testing.T, r dsref.Loader, putFunc PutDatasetFunc)
AssertLoaderSpec confirms the expected behaviour of a dsref.Loader Interface implementation. In addition to this test passing, implementations MUST be nil-callable. Please add a nil-callable test for each implementation
TODO(b5) - this test isn't working network sources. At the moment it confirms only basic requirements of a local loader function
func AssertResolverSpec ¶
func AssertResolverSpec(t *testing.T, r dsref.Resolver, putFunc PutRefFunc)
AssertResolverSpec confirms the expected behaviour of a dsref.Resolver Interface implementation. In addition to this test passing, implementations MUST be nil-callable. Please add a nil-callable test for each implementation
func ConsistentResolvers ¶
ConsistentResolvers checks that a set of resolvers return equivalent values for a given reference this function will not fail the test on error, only write warnings via t.Log
func ForeignLogbook ¶
ForeignLogbook creates a logbook to use as an external source of oplog data
func GenerateExampleDataset ¶
GenerateExampleDataset creates an example dataset document
Types ¶
type PutDatasetFunc ¶
PutDatasetFunc adds a dataset to a system that stores datasets PutDatasetFunc is required to run the LoaderSpec test. When called the Loader should retain the dataset for later loading by the spec test, and return a full reference to the saved version
type PutRefFunc ¶
PutRefFunc adds a reference to a system that retains references PutRefFunc is required to run the ResolverSpec test, when called the Resolver should retain the reference for later retrieval by the spec test. PutRefFunc also passes the author & oplog that back the reference