Skip to content

Commit

Permalink
refactor(layout): simplify and doc split() (#405)
Browse files Browse the repository at this point in the history
* test(layout): add tests for split()

* refactor(layout): simplify and doc split()

This is mainly a reduction in density of the code with a goal of
improving mainatainability so that the algorithm is clear.
  • Loading branch information
joshka committed Aug 17, 2023
1 parent ea48af1 commit de25de0
Show file tree
Hide file tree
Showing 3 changed files with 631 additions and 254 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ criterion = { version = "0.5", features = ["html_reports"] }
fakeit = "1.1"
itertools = "0.10"
rand = "0.8"
pretty_assertions = "1.4.0"

[[bench]]
name = "block"
Expand Down
1 change: 1 addition & 0 deletions src/backend/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ impl TestBackend {
/// Asserts that the TestBackend's buffer is equal to the expected buffer.
/// If the buffers are not equal, a panic occurs with a detailed error message
/// showing the differences between the expected and actual buffers.
#[track_caller]
pub fn assert_buffer(&self, expected: &Buffer) {
assert_eq!(expected.area, self.buffer.area);
let diff = expected.diff(&self.buffer);
Expand Down

0 comments on commit de25de0

Please sign in to comment.