hegeltest 0.9.0 copy "hegeltest: ^0.9.0" to clipboard
hegeltest: ^0.9.0 copied to clipboard

Property-based testing for Dart, powered by Hegel's native engine. Automatically finds edge cases by generating random inputs and shrinking failures to minimal counterexamples.

0.9.0 #

  • New: tc.classify(condition, observation, {label}) — conditional observation tracking combinator for input distribution monitoring.
  • New: tc.cover(minPercentage, condition, label) — minimum distribution coverage assertion. Asserts that edge cases are exercised across at least minPercentage% of valid test cases, throwing InsufficientCoverageException if unmet.
  • New: sampledWeighted(List<(int, T)>) — generator for weighted sampling from raw values without requiring generator wrapping.
  • New: oneOfWeighted(List<(int, Generator<T>)>) — discoverable alias for frequency() matching the oneOf combinator naming convention.
  • New: Export InsufficientCoverageException from root library.

0.8.0 #

  • New: Persistent Counterexample Database — automatically caches failing counterexamples to .hegel/examples/ (scoped by test description). Subsequent runs replay known failing examples first on iteration 1 during Phase.reuse for instant regression detection.
  • New: Automatic .gitignore created inside .hegel/ to keep developer worktrees clean.
  • New: Opt-out support via database: false parameter or HEGEL_DATABASE=0 environment variable.
  • New: Custom database storage support via databasePath: String.
  • New: example/database_example.dart and comprehensive test/database_test.dart suite.

0.7.0 #

  • New: tc.collect() — observation distribution tracking API. Gather and verify input distributions across valid test cases. Automatically discards observations from rejected cases (tc.assume).
  • New: RunResult.statistics & RunResult.formatStatistics() — access and format collected observations programmatically.
  • Reporting: Formatted statistics distribution is printed automatically on test completion when verbosity: Verbosity.verbose.
  • Quality: Resolved all linter infos and dangling doc comments across lib/ for 100% pub.dev score (160/160 points). Replaced deprecated package:test_api import with package:test.

0.6.1 #

  • Fix: Add runWithResult() to web stub HegelRunner — fixes undefined_method analyzer error in downstream packages (e.g. hegeltest_flutter)

0.6.0 #

  • New: runHegelTest() — standalone property runner that returns RunResult without package:test dependency. Use for custom runners, CI integration, or programmatic analysis.
  • New: Examples — stateful testing (StackMachine, Pool<String>), composite generators (User, Address), and reproduction workflow
  • New: Test coverage for temporal (dates, times, dateTimes), network (ipv4Addresses, ipv6Addresses), and urls() generators
  • Docs: CONTRIBUTING.md, CODE_OF_CONDUCT.md, issue/PR templates
  • Docs: README — documented assume(), target(), named draws, HEGEL_SEED, database/databaseKey, advanced settings, standalone runner

0.5.0 #

  • Breaking: Minimum Dart SDK bumped to >=3.10.0 (was >=3.4.0)
  • New: Native Assets integration — hook/build.dart registers prebuilt binaries automatically. No more manual path resolution.
  • Simplified library_loader.dart (297 → 170 lines)
  • Moved SHA256 integrity verification to build time (hook/build.dart)
  • CI now tests native assets workflow (not env override)
  • Added hooks and code_assets dependencies
  • Graceful handling of unsupported targets (returns empty asset list, no build crash)
  • HEGEL_LIBHEGEL_PATH env override still works (runtime only)

Migration: If on Dart >=3.10.0, just bump to hegeltest: ^0.5.0. If on Dart <3.10.0, stay on hegeltest: ^0.4.0 (security fixes only).

0.4.0 #

  • New: Stateful (model-based) testing — hegelStatefulTest(), StateMachine, StateRule, StateInvariant
  • New: Pool<T> for typed value tracking across rules (reusable/consumed draws)
  • New: Structured preconditions on rules — evaluated before engine selection, not inside rule bodies
  • Engine-driven Swarm Testing automatically explores rule subsets
  • Automatic shrinking of step sequences to minimal counterexamples

0.3.0 #

  • Security: SHA256 integrity verification for all bundled native binaries
  • Supply chain: Bundled .sha256 checksum files alongside each binary
  • Binaries are verified before loading — corrupted/tampered files throw StateError with actionable error message

0.2.2 #

  • Fix: Library loader finds native binary in flutter test via package_config.json fallback

0.2.1 #

  • API: Export HegelRunner and loadHegelLibrary for downstream packages (e.g. hegeltest_flutter)
  • DX: Clean up test imports to use package exports only

0.2.0 #

  • Cross-platform: Bundled native binaries for Linux x64, Linux arm64, Windows x64, and Windows arm64
  • Safety: ABI version check on library load — prevents segfaults from mismatched binary versions
  • Upgrade: Native engine updated to hegel-rust v0.32.2
  • CI: Tests now run on macOS, Linux, and Windows

0.1.2 #

  • Web compat: Conditional imports — web projects that import hegeltest compile cleanly (throws UnsupportedError at runtime)
  • DX: HegelTestFailure extends TestFailure from package:test_api — cleaner test output without framework stack traces
  • Fix: Pre-existing type errors in example and reproduce_test

0.1.1 #

  • Performance: Cache string generator handles per context (was recompiling regex per draw)
  • Performance: BigInt byte extraction via bit shifts (was string parsing per draw)
  • Performance: Replace Arena malloc/free with reuseBuffer in all combinators + collections
  • Performance: Cache Generator.typeName (was runtimeType.toString() per draw)
  • Performance: Rewrite tuple generators as direct subclasses (removes double-span + Arena)
  • Fix: Clone finalizer now frees _bufferCache (was leaking FFI pointers on GC)
  • Fix: BigInt outLen bounds check prevents out-of-bounds read
  • Fix: Blob replay now calls setUpEach/tearDownEach and wraps body in zone guard
  • Fix: Late async errors logged to stderr (was silently swallowed)
  • Fix: FilteredGenerator separates predicate rejection from exception in hadError
  • Fix: Collection rejection sets hadError correctly before HegelAssumptionViolated
  • Fix: toString() safety in counterexample formatting (catches throwing toString)
  • Fix: Surrogate-safe truncation via runes.take(200)
  • DX: tearDownEach errors now include full stack trace
  • DX: HegelConfig fields have dartdocs
  • DX: where() accepts maxAttempts parameter (default 100)
  • DX: Reproduce blob validated for NUL bytes before FFI boundary

0.1.0 #

  • Initial release
  • Core hegelTest() integration with package:test
  • 25+ generators: primitives, text, collections, combinators, temporal, network, bytes
  • Generator composition: map(), flatMap(), where(), Generator.composite()
  • HegelConfig for reusable test configuration
  • Per-iteration isolation via setUpEach/tearDownEach
  • Counterexample recording with draw log in failure messages
  • Reproduction blobs for deterministic failure replay
  • Buffer reuse optimization for primitive generators
  • Comprehensive dartdocs on all public APIs
0
likes
150
points
531
downloads

Documentation

API reference

Publisher

verified publisherletstesttools.dev

Weekly Downloads

Property-based testing for Dart, powered by Hegel's native engine. Automatically finds edge cases by generating random inputs and shrinking failures to minimal counterexamples.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#testing #property-based-testing #fuzzing #test-generation

License

MIT (license)

Dependencies

code_assets, crypto, ffi, hooks, meta, test, test_api

More

Packages that depend on hegeltest