fhirpathtest

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

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

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

func AssertEmpty(t *testing.T, eng fhirpath.Engine, env *types.ResourceEnvelope, expr string)

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

func DefaultEngine(t *testing.T) fhirpath.Engine

DefaultEngine returns a FHIRPath engine for tests.

func Eval

func Eval(t *testing.T, eng fhirpath.Engine, env *types.ResourceEnvelope, expr string) []string

Eval evaluates expr against env and returns stringified values.

Types

This section is empty.

Jump to

Keyboard shortcuts

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