This is a small utility intended to ease verifying conditions for complex testing. It is an offshot from a much more extensive library at github.com/hackborn/jacl.
Run compares a list of terms against a target. Target can be anything.
Terms are described by the grammar
{term} = {path}{comparison_operator}{value}
Where {path} is a "/" separated list of identifiers
{comparison_operator} is "="
{value} is a string
{path} identifiers can be either an integer to index slices, or
a string for named fields.
Example term:
"0/Name=Ireland"
where the target is a slice of structs that have a Name field.
RunErr compares two errors, returning if they do not match.
I use a soft definition of "match"; the errors can be different,
it just checks if they are both nil or not. Ideally, error messages
are not part of an API.
RunOpts compares a list of terms against a target. Target can be anything.
See Run docs for a decription of target and terms.
Opts adds some configuration options, see Opts docs for a description.
type Opts struct {
// If RawValues is true then the value tokens are left// completely unprocessed.// If it is false, then processing is applied:// * Two single quotes (”) are replaced with a double quote (").// Default is false.
RawValues bool
}