mirror of
https://github.com/jj-vcs/jj.git
synced 2025-12-23 06:01:01 +00:00
This adds the proptest crate for property-based testing as well as the proptest-state-machine crate as direct dev dependencies of jj-cli and as dependencies of the internal testutils crate. Within testutils, a `proptest` module provides a reference state machine which models the working copy as a map from path to `DirEntry`. Directories are not represented explicitly, but are implicit in the ancestors of entries. The possible transitions of this state machine are for now limited to the creation of new files (including replacements of existing files or directories) and a `Commit` operation which the SUT can use to snapshot a reference state. Additional transitions (moving files, modifying file contents incrementally, ...) and states (symlinks, submodules, conflicts, ...) may be added in the future. This reference state machine is then applied to the builtin merge-tool's test suite: - The initial state is always an empty root directory. - The `Commit` operation creates `MergedTree` from the current state. - Each step of the way, the same test logic as in the manual `test_edit_diff_builtin*` tests is run to check that splitting off none or all of the changes results in the left or right tree, respectively. The "right" tree corresponds to the current state, whereas the "left" tree refers to the last "committed" tree. Co-authored-by: Waleed Khan <me@waleedkhan.name> |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||