package test
import "github.com/open-policy-agent/opa/util/test"
Package test contains utilities used in the policy engine's test suite.
Index ¶
- func MakeTempFS(files map[string]string) (rootDir string, cleanup func(), err error)
- func Subtest(t *testing.T, name string, f func(*testing.T))
- func WithTempFS(files map[string]string, f func(string))
Functions ¶
func MakeTempFS ¶
MakeTempFS creates a temporary directory structure for test purposes. If the creation fails, cleanup is nil and the caller does not have to invoke it. If creation succeeds, the caller should invoke cleanup when they are done.
func Subtest ¶
Subtest executes a sub-test f under test t.
func WithTempFS ¶
WithTempFS creates a temporary directory structure and invokes f with the root directory path.
Source Files ¶
- Version
- v0.5.7
- Published
- Sep 8, 2017
- Platform
- js/wasm
- Imports
- 4 packages
- Last checked
- 2 minutes ago –
Tools for package owners.