Skip to content

Commit

Permalink
Fix unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
KmolYuan committed Dec 18, 2023
1 parent 77bf7c2 commit 62dbd7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 6 additions & 7 deletions plotters/src/element/basic_shapes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,21 +231,20 @@ impl<I0: Iterator + Clone, Size: SizeDesc, DB: DrawingBackend> Drawable<DB>
fn test_dashed_path_element() {
use crate::prelude::*;
let check_list = std::cell::RefCell::new(vec![
[(100, 100), (100, 103)],
[(100, 105), (100, 110)],
[(100, 112), (100, 117)],
[(100, 119), (100, 120)],
vec![(100, 100), (100, 103), (100, 118)],
vec![(100, 105), (100, 110)],
vec![(100, 112), (100, 117)],
vec![(100, 119), (100, 120)],
]);
let da = crate::create_mocked_drawing_area(300, 300, |m| {
m.check_draw_path(move |c, s, path| {
assert_eq!(c, BLUE.to_rgba());
assert_eq!(s, 7);
dbg!(&path);
assert_eq!(path, check_list.borrow_mut().remove(0));
});
m.drop_check(|b| {
assert_eq!(b.num_draw_path_call, 4);
assert_eq!(b.draw_count, 4);
assert_eq!(b.num_draw_path_call, 1);
assert_eq!(b.draw_count, 1);
});
});
da.draw(&DashedPathElement::new(
Expand Down
4 changes: 2 additions & 2 deletions plotters/src/series/line_series.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ mod test {
});

m.drop_check(|b| {
assert_eq!(b.num_draw_path_call, 26);
assert_eq!(b.draw_count, 26);
assert_eq!(b.num_draw_path_call, 9);
assert_eq!(b.draw_count, 9);
});
});

Expand Down

0 comments on commit 62dbd7b

Please sign in to comment.