Skip to content

v0.1.0

Latest

Choose a tag to compare

@nassersala nassersala released this 20 Aug 10:15
· 5 commits to main since this release

First release. Property-based testing for Swift on Antithesis's Hegel engine (libhegel v0.32.5, vendored as a binary target for macOS arm64, iOS device, and iOS simulator).

What's in

  • Gen<Value> witness-style generators with map/flatMap/filter/zip; no Arbitrary protocol
  • Draws: integers (including UInt64/Int128/UInt128), booleans, doubles, bytes, collections, Unicode/regex/email/URL strings, dates/times/datetimes, UUIDs, IPv4/IPv6
  • Shrinking via the engine's choice sequences: no shrinker code, ever; failures carry version-pinned reproduce blobs and replay for display
  • Settings: seed, derandomize, database path/key, phases, multiple-failure reporting, verbosity, single-test-case mode, stateful step count
  • Stateful testing: forAll(initial:rules:invariants:) with preconditions, whole-step shrinking, pools, and minimal rule-trace counterexamples
  • Targeted generation: tc.target(score) and stateful maximize:
  • Swift Testing integration: expectAll + .propertyTesting trait — #expect failures shrink
  • Output callback into a Swift closure

Evidence

  • 56 tests, including known-minimum shrink assertions for every primitive family
  • Differential conformance: byte-identical draw transcripts vs hegel-go under the same seed, driving the same engine binary
  • Worked examples: adhan-swift dogfood (found batoulapps/adhan-swift#102 on the first run), the Die Hard puzzle solved by the shrinker, and affordance correctness for UI state machines

Requirements

Swift 6.2+ (Xcode 26), macOS 14+ / iOS 17+, Apple Silicon.

Unofficial binding; not affiliated with Antithesis. libhegel binaries are built unmodified from the hegel-rust v0.32.5 tag (MIT).