Skip to content

Commit

Permalink
tests(iroh-sync): initial batch of property based tests for the range…
Browse files Browse the repository at this point in the history
…r and store (#1428)

## Description

This adds some property based tests for the ranger and fixes a bug in
the pivot selection when splitting ranges

## Notes & open questions

## Change checklist

- [x] Self-review.
- [x] Tests if relevant.
  • Loading branch information
rklaehn authored Aug 30, 2023
1 parent c21a2d1 commit 9db3694
Show file tree
Hide file tree
Showing 5 changed files with 269 additions and 160 deletions.
37 changes: 37 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions iroh-sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ futures = { version = "0.3", optional = true }
[dev-dependencies]
tokio = { version = "1", features = ["sync", "macros"] }
tempfile = "3.4"
proptest = "1.2.0"
test-strategy = "0.3.1"

[features]
default = ["net", "fs-store", "metrics"]
Expand Down
8 changes: 8 additions & 0 deletions iroh-sync/proptest-regressions/ranger.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Seeds for failure cases proptest has generated in the past. It is
# automatically read and these particular cases re-run before any
# novel cases are generated.
#
# It is recommended to check this file in to source control so that
# everyone who runs the test benefits from these saved cases.
cc 797e83179f8684388880e25a6fac7b4047eb15b03c55c1fb725b82bdbd0a4369 # shrinks to a = {TestKey("3"): ()}, b = {TestKey(""): (), TestKey("3"): (), TestKey("4"): (), TestKey("5"): (), TestKey("a"): (), TestKey("b"): (), TestKey("c"): ()}
cc f5b7604319ead6181c2ff42e53f05e2c6f0298adf0b38ea4ae4710c43abb7663 # shrinks to input = _SimpleStoreSyncArgs { alice: [(3, ()), (a, ())], bob: [(, ()), (0, ()), (b, ())] }
Loading

0 comments on commit 9db3694

Please sign in to comment.