Skip to content

Commit

Permalink
Avoid dropping results in counter test
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Dec 17, 2024
1 parent ecd5227 commit e5545aa
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions examples/counter/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ mod tests {
let mut counter = Counter { value: 0 };
let mut ui = simulator(counter.view());

let _ = ui.click(text("Increment"));
let _ = ui.click(text("Increment"));
let _ = ui.click(text("Decrement"));
let _ = ui.click(text("Increment"))?;
let _ = ui.click(text("Increment"))?;
let _ = ui.click(text("Decrement"))?;

for message in ui.into_messages() {
counter.update(message);
Expand All @@ -61,7 +61,6 @@ mod tests {
assert_eq!(counter.value, 1);

let mut ui = simulator(counter.view());

assert!(ui.find(text("1")).is_ok(), "Counter should display 1!");

Ok(())
Expand Down

0 comments on commit e5545aa

Please sign in to comment.