# LibTmux.Snapshot.Fixture

- **Package:** libtmux-haskell
- **Language:** Haskell
- **Kind:** module
- **Source:** https://github.com/libtmux/libtmux-haskell/blob/663e212622a02aa74a9bdc8ff71e2b45fcb1d4d5/src/LibTmux/Snapshot/Fixture.hs
- **Page:** https://libtmux.org/en/haskell/latest/reference/libtmux-snapshot-fixture/

Build validated detached snapshots for pure application tests.

No operation in this module contacts tmux. Named fixture references can
 model successive observations; they never equal a live Server generation.
 Snapshot and live-reference constructors remain hidden.
 Validation checks graph and metadata laws; wire decoding, tmux normalization
 and transport limits belong to acquisition rather than fixture construction.

Start with [`fixtureOrigin`](/en/haskell/latest/reference/libtmux-snapshot-fixture-v-fixtureorigin/) and [`emptyFixture`](/en/haskell/latest/reference/libtmux-snapshot-fixture-v-emptyfixture/), construct ordinary observation
 records using this module's reference builders, then call [`validateFixture`](/en/haskell/latest/reference/libtmux-snapshot-fixture-v-validatefixture/).

# What is on here

Its exports fall into these groups, in export-list order:

**Offline identity**

[`FixtureOrigin`](/en/haskell/latest/reference/libtmux-snapshot-fixture-t-fixtureorigin/), [`fixtureOrigin`](/en/haskell/latest/reference/libtmux-snapshot-fixture-v-fixtureorigin/), [`fixtureGeneration`](/en/haskell/latest/reference/libtmux-snapshot-fixture-v-fixturegeneration/), [`sessionRef`](/en/haskell/latest/reference/libtmux-snapshot-fixture-v-sessionref/), [`windowRef`](/en/haskell/latest/reference/libtmux-snapshot-fixture-v-windowref/), [`paneRef`](/en/haskell/latest/reference/libtmux-snapshot-fixture-v-paneref/)

**Complete fixture inputs**

[`Fixture`](/en/haskell/latest/reference/libtmux-snapshot-fixture-t-fixture/), [`AttachedClient`](/en/haskell/latest/reference/libtmux-snapshot-fixture-t-attachedclient/), [`emptyFixture`](/en/haskell/latest/reference/libtmux-snapshot-fixture-v-emptyfixture/)

**Validation**

[`FixtureError`](/en/haskell/latest/reference/libtmux-snapshot-fixture-t-fixtureerror/), [`validateFixture`](/en/haskell/latest/reference/libtmux-snapshot-fixture-v-validatefixture/)

## Members

### Common operations

- [`emptyFixture`](/en/haskell/latest/reference/libtmux-snapshot-fixture-v-emptyfixture/) (function): Empty complete inputs with explicit synthetic metadata: PID 1, epoch 0
 and path `fixture:offline`. No process or socket exists by implication.
 The version and every edited field are checked by :obj:`validateFixture <LibTmux.Snapshot.Fixture#v:validateFixture>`.
- [`FixtureError`](/en/haskell/latest/reference/libtmux-snapshot-fixture-t-fixtureerror/) (data type): A failed graph or complete-snapshot validation, with domain
 context from the validator. Failed input never becomes an empty snapshot.
- [`fixtureOrigin`](/en/haskell/latest/reference/libtmux-snapshot-fixture-v-fixtureorigin/) (function): Select a pure fixture namespace. No endpoint lookup or random IO occurs.
- [`validateFixture`](/en/haskell/latest/reference/libtmux-snapshot-fixture-v-validatefixture/) (function): Validate and force owned values using the capture graph's invariants.
 Successful fixtures have no acquisition interval and carry offline
 provenance. Their references cannot equal references from a Server scope.

### Other members

- [`AttachedClient`](/en/haskell/latest/reference/libtmux-snapshot-fixture-t-attachedclient/) (data type): An attached client's native identity and context before graph validation.
 Validation resolves its values from the same snapshot; it never trusts a
 caller-supplied nested attachment record.
- [`Fixture`](/en/haskell/latest/reference/libtmux-snapshot-fixture-t-fixture/) (data type): Ordinary finite inputs. Validation applies the captured graph's laws;
 record construction or updates alone do not establish those laws.
- [`fixtureGeneration`](/en/haskell/latest/reference/libtmux-snapshot-fixture-v-fixturegeneration/) (function): The offline generation for :obj:`Fixture <LibTmux.Snapshot.Fixture#t:Fixture>` metadata. Replacing it with a connection
 generation causes :obj:`validateFixture <LibTmux.Snapshot.Fixture#v:validateFixture>` to reject the metadata.
- [`FixtureOrigin`](/en/haskell/latest/reference/libtmux-snapshot-fixture-t-fixtureorigin/) (data type): A named offline namespace. Equal names deliberately compare equal, so
 tests can model successive observations. This cannot represent a Server.
- [`paneRef`](/en/haskell/latest/reference/libtmux-snapshot-fixture-v-paneref/) (function): Construct a pane reference without consulting or targeting a daemon.
- [`sessionRef`](/en/haskell/latest/reference/libtmux-snapshot-fixture-v-sessionref/) (function): Construct a session reference that belongs only to this offline origin.
- [`windowRef`](/en/haskell/latest/reference/libtmux-snapshot-fixture-v-windowref/) (function): Construct a physical window reference without granting live authority.

## Guides

Pages that discuss `LibTmux.Snapshot.Fixture`.

- [Offline fixtures](/en/haskell/latest/guides/offline-fixtures/)
- [Implementation status](/en/haskell/latest/guides/status/)
