testutil

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCanonical

func GetCanonical(t *testing.T, raw string) string

GetCanonical converts the given JSON string into a canonical JSON.

func GetCanonicalBytes

func GetCanonicalBytes(t *testing.T, raw string) []byte

GetCanonicalBytes converts the given JSON string into a canonical JSON (returning the bytes).

func GetExpiryService

func GetExpiryService(t *testing.T) *expiry.Service

GetExpiryService returns test expiry service object. For most tests, the expiry service used doesn't really matter this object is just needed to ensure that no nil pointer errors happen when initializing the store.

func GetLoader

func GetLoader(t *testing.T) *ld.DocumentLoader

GetLoader returns document loader.

func MarshalCanonical

func MarshalCanonical(t *testing.T, i interface{}) []byte

MarshalCanonical marshals the given object to a canonical JSON.

func MustParseURL

func MustParseURL(raw string) *url.URL

MustParseURL parses the given string and returns the URL. If the given string is not a valid URL then the function panics.

func NewMockID

func NewMockID(iri fmt.Stringer, path string) *url.URL

NewMockID returns a URL using the base IRI and the given path.

func NewMockURLs

func NewMockURLs(num int, getURI func(i int) string) []*url.URL

NewMockURLs returns the given number of URLs using the given function to format each one.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL