Documentation
¶
Overview ¶
Package fhirpathtest provides convenience wrappers around pkg/fhirpath for tests.
No custom FHIRPath engine logic lives here — only assertion helpers that evaluate expressions against *types.ResourceEnvelope fixtures (or envelope.Proto when set).
- DefaultEngine — fhirpath.NewEngine with default config for test isolation
- Eval — evaluate and return stringified result values
- AssertValues, AssertString, AssertEmpty, AssertContains — test assertions
Use fixtures or factories to supply envelopes; use this package to assert expression results without duplicating engine setup in every test file.
Index ¶
- func AssertContains(t *testing.T, eng fhirpath.Engine, env *types.ResourceEnvelope, ...)
- func AssertEmpty(t *testing.T, eng fhirpath.Engine, env *types.ResourceEnvelope, expr string)
- func AssertString(t *testing.T, eng fhirpath.Engine, env *types.ResourceEnvelope, ...)
- func AssertValues(t *testing.T, eng fhirpath.Engine, env *types.ResourceEnvelope, expr string, ...)
- func DefaultEngine(t *testing.T) fhirpath.Engine
- func Eval(t *testing.T, eng fhirpath.Engine, env *types.ResourceEnvelope, expr string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertContains ¶
func AssertContains(t *testing.T, eng fhirpath.Engine, env *types.ResourceEnvelope, expr, want string)
AssertContains asserts at least one result value equals want.
func AssertEmpty ¶
AssertEmpty asserts the expression evaluates to an empty collection.
func AssertString ¶
func AssertString(t *testing.T, eng fhirpath.Engine, env *types.ResourceEnvelope, expr, want string)
AssertString asserts EvalString matches want.
func AssertValues ¶
func AssertValues(t *testing.T, eng fhirpath.Engine, env *types.ResourceEnvelope, expr string, want ...string)
AssertValues asserts the expression result matches want values (order-sensitive).
func DefaultEngine ¶
DefaultEngine returns a FHIRPath engine for tests.
Types ¶
This section is empty.