hegeltest 0.9.0
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 leastminPercentage% of valid test cases, throwingInsufficientCoverageExceptionif 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 forfrequency()matching theoneOfcombinator naming convention. - New: Export
InsufficientCoverageExceptionfrom 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 duringPhase.reusefor instant regression detection. - New: Automatic
.gitignorecreated inside.hegel/to keep developer worktrees clean. - New: Opt-out support via
database: falseparameter orHEGEL_DATABASE=0environment variable. - New: Custom database storage support via
databasePath: String. - New:
example/database_example.dartand comprehensivetest/database_test.dartsuite.
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 deprecatedpackage:test_apiimport withpackage:test.
0.6.1 #
- Fix: Add
runWithResult()to web stubHegelRunner— fixesundefined_methodanalyzer error in downstream packages (e.g.hegeltest_flutter)
0.6.0 #
- New:
runHegelTest()— standalone property runner that returnsRunResultwithoutpackage:testdependency. 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), andurls()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.dartregisters 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
hooksandcode_assetsdependencies - Graceful handling of unsupported targets (returns empty asset list, no build crash)
HEGEL_LIBHEGEL_PATHenv 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 onhegeltest: ^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
.sha256checksum files alongside each binary - Binaries are verified before loading — corrupted/tampered files throw
StateErrorwith actionable error message
0.2.2 #
- Fix: Library loader finds native binary in
flutter testviapackage_config.jsonfallback
0.2.1 #
- API: Export
HegelRunnerandloadHegelLibraryfor 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
UnsupportedErrorat runtime) - DX:
HegelTestFailureextendsTestFailurefrompackage: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
reuseBufferin all combinators + collections - Performance: Cache
Generator.typeName(wasruntimeType.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
outLenbounds check prevents out-of-bounds read - Fix: Blob replay now calls
setUpEach/tearDownEachand wraps body in zone guard - Fix: Late async errors logged to stderr (was silently swallowed)
- Fix:
FilteredGeneratorseparates predicate rejection from exception inhadError - Fix: Collection rejection sets
hadErrorcorrectly beforeHegelAssumptionViolated - Fix:
toString()safety in counterexample formatting (catches throwingtoString) - Fix: Surrogate-safe truncation via
runes.take(200) - DX:
tearDownEacherrors now include full stack trace - DX:
HegelConfigfields have dartdocs - DX:
where()acceptsmaxAttemptsparameter (default 100) - DX: Reproduce blob validated for NUL bytes before FFI boundary
0.1.0 #
- Initial release
- Core
hegelTest()integration withpackage:test - 25+ generators: primitives, text, collections, combinators, temporal, network, bytes
- Generator composition:
map(),flatMap(),where(),Generator.composite() HegelConfigfor 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