Skip to content

ema: Add hspec test suite (closes #178)#180

Merged
srid merged 2 commits intomasterfrom
crazy-world
Apr 24, 2026
Merged

ema: Add hspec test suite (closes #178)#180
srid merged 2 commits intomasterfrom
crazy-world

Conversation

@srid
Copy link
Copy Markdown
Owner

@srid srid commented Apr 24, 2026

Summary

  • Adds a test test-suite stanza to ema.cabal so feature PRs can land unit tests alongside code.
  • Seeds it with Ema.DynamicSpec exercising Ema.Dynamic.currentValue (Add Ema.Dynamic.currentValue for out-of-band reads #177): initial value before any update, and latest value after the wrapped updater runs.
  • Uses plain hspec rather than hspec-discover — the nix-provided Haskell env does not expose the hspec-discover executable, so specs are wired up manually in test/Spec.hs.

Closes #178.

Test plan

  • cabal test --enable-tests ema:test:test — 2 of 2 pass
  • cabal-fmt and fourmolu pre-commit hooks pass

🤖 Generated with Claude Code

srid added 2 commits April 24, 2026 14:33
Closes #178. Adds the `test` test-suite stanza so future feature
PRs can land unit tests alongside code. Seeds it with specs for
`Ema.Dynamic.currentValue` (#177) covering the initial value and
the wrapped updater.
Extends DynamicSpec to exercise fmap (initial value + updater),
pure (no-op updater), and liftA2 (combined initial value + updates
from both sides, serialized by the internal sendLock).

liftA2 is driven through currentValue and gated with MVars so the
assertions don't rely on timing.
@srid srid merged commit 7fe5303 into master Apr 24, 2026
2 checks passed
@srid srid deleted the crazy-world branch April 24, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add runtime test suite for ema lib

1 participant