zizek 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +115 -0
- data/GUIDE.md +774 -0
- data/LICENSE +201 -0
- data/README.md +201 -0
- data/docs/assets/zizek-rb-logo-dark.svg +16 -0
- data/docs/assets/zizek-rb-logo.svg +16 -0
- data/examples/combinators.rb +93 -0
- data/examples/coverage_assertions.rb +138 -0
- data/examples/database_workflow.rb +120 -0
- data/examples/die_hard.rb +122 -0
- data/examples/hypothesis_quickstart.rb +44 -0
- data/examples/keyed_draws.rb +123 -0
- data/examples/ledger.rb +114 -0
- data/examples/min_stack.rb +108 -0
- data/examples/minitest_suite.rb +64 -0
- data/examples/multi.rb +46 -0
- data/examples/queue.rb +122 -0
- data/examples/roundtrip.rb +71 -0
- data/examples/stack.rb +68 -0
- data/examples/tour.rb +126 -0
- data/lib/zizek/database.rb +211 -0
- data/lib/zizek/gen.rb +10377 -0
- data/lib/zizek/generators.rb +879 -0
- data/lib/zizek/minitest.rb +94 -0
- data/lib/zizek/rspec.rb +67 -0
- data/lib/zizek/settings.rb +249 -0
- data/lib/zizek/shell.rb +2938 -0
- data/lib/zizek/stateful.rb +349 -0
- data/lib/zizek/version.rb +8 -0
- data/lib/zizek.rb +8 -0
- metadata +109 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 56550f1df48e9289714d76af41df79738652c10e11109dadf88701f8d9ad8a92
|
|
4
|
+
data.tar.gz: 3e8be13c05032b6801c870bbd652777677d023561ccf9e378d36bcc52149abb1
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 8fbc8669a860b93a6471991677b38beb4221d65f60f73e0021e2c2f7f15d3f52f1d90ac80b990d1f62e0d5c431581bafa32a1ff8a114a6bc0b09debda714af0d
|
|
7
|
+
data.tar.gz: 758527d12cc63a504bcda8f65d084b2f5ba50e571d66d5885f2b613a0d72ae9110911f25fd47d5392bbaa7d00ecd917b48f0b47a03e5cdbd533e3e0c1a6f5acf
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the Ruby package are recorded here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses
|
|
5
|
+
[semantic versioning](https://semver.org/spec/v2.0.0.html) — while the version
|
|
6
|
+
is `0.x`, the API may change in any release.
|
|
7
|
+
|
|
8
|
+
## [0.1.0] - 2026-10-27
|
|
9
|
+
|
|
10
|
+
First release of the Ruby package.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `Zizek.check` — sequential property exploration with deterministic seeds,
|
|
15
|
+
accepting either a lambda or a block.
|
|
16
|
+
- Recorded integer, boolean, byte-string, IEEE-754 float, and Unicode text
|
|
17
|
+
draws, with boundary-biased integer generation.
|
|
18
|
+
- `Zizek::Generators` — composable, immutable generator builders with `map`
|
|
19
|
+
and `filter`, plus `lists`, `sets`, `hashes`, and `lists(unique_by:)`.
|
|
20
|
+
- Per-choice shrinking with element-span and rule-span deletion, so a failure
|
|
21
|
+
is reported at its minimal counterexample.
|
|
22
|
+
- Portable reproduce blobs: `Zizek.check(property, reproduce: blob)` replays
|
|
23
|
+
the recorded example, including blobs emitted by the Go, Python, Rust, Zig,
|
|
24
|
+
TypeScript, Java, C++, and Clojure packages.
|
|
25
|
+
- Choice punning and overrun detection on replay, with punned draws counted
|
|
26
|
+
and reported on the failure.
|
|
27
|
+
- Coverage assertions (`test_case.cover`) that fail a completed run for an
|
|
28
|
+
example it never produced.
|
|
29
|
+
- Stateful testing: rules, invariants, notes, and a default budget of 50
|
|
30
|
+
successful steps, with reusable and consumed pools of arbitrary Ruby objects.
|
|
31
|
+
- `test_case.clone_stream` — a child test case drawing from a stream of its
|
|
32
|
+
own, framed in the parent's blob and shrunk by the same schedule.
|
|
33
|
+
- Generation-phase span mutation, which duplicates same-label spans to
|
|
34
|
+
discover repeated values and repeated state-machine operations.
|
|
35
|
+
- Assumption-based rejection with configurable limits.
|
|
36
|
+
- Runnable examples under `examples/`, including ports of Hypothesis's
|
|
37
|
+
introductory property and all five top-level Hegel examples.
|
|
38
|
+
- Named draws: `test_case.draw(generator, name: :total)` reports the value in
|
|
39
|
+
the failure's `Falsifying example:` line. A name is a label for the report
|
|
40
|
+
only — it records no choice, so a named draw and an anonymous one shrink to
|
|
41
|
+
the same blob.
|
|
42
|
+
- `Zizek::Failure` carries `values`, `seed`, and `costs`, and renders all
|
|
43
|
+
three in its message alongside the cause and the reproduce blob.
|
|
44
|
+
- `Zizek.run` returns the outcome as a `Zizek::Result` instead of raising, for
|
|
45
|
+
a harness that wants the verdict as a value. `Zizek.check` still raises.
|
|
46
|
+
- An example database: `database:` and `database_key:` on `Zizek.check` and
|
|
47
|
+
`Zizek::Settings`, with `Zizek::Database::Directory` and
|
|
48
|
+
`Zizek::Database::Memory`. A stored counterexample is replayed before
|
|
49
|
+
anything is generated, and one that no longer reproduces is deleted. The
|
|
50
|
+
layout — raw choice streams under a portable FNV-1a key — is shared with the
|
|
51
|
+
Python and Go packages, so a failure found in one replays in the others. Off
|
|
52
|
+
until asked for.
|
|
53
|
+
- `Zizek::Settings`, a frozen value object with `with`, rejecting unknown
|
|
54
|
+
names at construction; named profiles via `register_profile`,
|
|
55
|
+
`load_profile`, and `with_profile`; and `derandomize`, which derives the
|
|
56
|
+
seed from where the property was written.
|
|
57
|
+
- Keyword generator factories — `integers(min:, max:, shrink_towards:)` and
|
|
58
|
+
`floats(...)` — equivalent to the fluent builders, which remain. Bounded
|
|
59
|
+
generators also accept a range: `integers(0..100)`, `integers(0...100)`,
|
|
60
|
+
`integers(0..)`.
|
|
61
|
+
- `a | b` as `one_of`, flattening so a chain is one n-way choice;
|
|
62
|
+
`generator.example` for a REPL; `Generators.builds` for assembling an object
|
|
63
|
+
from drawn parts.
|
|
64
|
+
- `Zizek::Stateful::Machine` with `rule` and `invariant` class macros. Rule
|
|
65
|
+
bodies run against the machine, subclasses inherit their parent's rules, and
|
|
66
|
+
the DSL records the identical choice stream as a hand-built rule array.
|
|
67
|
+
- `zizek/minitest` and `zizek/rspec`: `property` defines a real test in each
|
|
68
|
+
framework. A failed assertion is reported as a failure and a raised
|
|
69
|
+
exception as an error, both carrying the falsifying example and the blob; a
|
|
70
|
+
passing property registers an assertion.
|
|
71
|
+
- Four feature-walkthrough examples, each deterministic and gated by the
|
|
72
|
+
package suite: `examples/coverage_assertions.rb` (the coverage assertion family),
|
|
73
|
+
`examples/keyed_draws.rb` (keyed vs positional replay across a property
|
|
74
|
+
edit), `examples/database_workflow.rb` (the example database's
|
|
75
|
+
store/replay/self-clean cycle), and `examples/combinators.rb` (generator
|
|
76
|
+
composition and shrinking through it).
|
|
77
|
+
- `GUIDE.md` sections for keyed draws, shrink costs, and cloned streams,
|
|
78
|
+
which the feature guide previously omitted.
|
|
79
|
+
|
|
80
|
+
### Changed
|
|
81
|
+
|
|
82
|
+
Nothing here has shipped, so these are recorded for the reader of the diff
|
|
83
|
+
rather than as migrations.
|
|
84
|
+
|
|
85
|
+
- `Zizek.check`'s `require:` keyword is now `must_cover:`, and
|
|
86
|
+
`Zizek::Coverage` takes `percent:` as a keyword.
|
|
87
|
+
- `Generators.composite` hands its block the test case rather than a bare
|
|
88
|
+
draw lambda, so a composite can `assume` and `note` the way a property can.
|
|
89
|
+
- `Zizek::Failure.new` takes keyword arguments.
|
|
90
|
+
- `Zizek::Coverage` moved to `lib/zizek/settings.rb`; the constant path is
|
|
91
|
+
unchanged.
|
|
92
|
+
- Enforce the Ruby public API boundary: engine namespaces and concrete
|
|
93
|
+
generator classes are private constants; test-case bookkeeping, generator
|
|
94
|
+
implementation readers, and configuration, database, and framework helpers
|
|
95
|
+
are private or protected. Calls to these formerly public internals must
|
|
96
|
+
migrate to the documented API. Generator `do_draw`, state-machine
|
|
97
|
+
`rules`/`invariants`, and database `fetch`/`save`/`delete` remain public
|
|
98
|
+
extension protocols.
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
### Fixed
|
|
102
|
+
|
|
103
|
+
- Documentation and comments referring to the old `require:` name for the
|
|
104
|
+
`must_cover:` option.
|
|
105
|
+
- The `# frozen_string_literal: true` magic comment in
|
|
106
|
+
`lib/zizek/generators.rb` sat mid-file, where it has no effect; it now
|
|
107
|
+
covers the file.
|
|
108
|
+
|
|
109
|
+
### Notes
|
|
110
|
+
|
|
111
|
+
- Pure Ruby, no compiled extension, and no runtime dependencies.
|
|
112
|
+
- Exercised on Ruby 3.3. `required_ruby_version` is `>= 2.6` because the
|
|
113
|
+
package uses nothing newer, but versions below 3.0 are not covered by CI.
|
|
114
|
+
|
|
115
|
+
[0.1.0]: https://github.com/wallyqs/zizek.rb/releases/tag/v0.1.0
|