Skip to content

Commit

Permalink
test-renderers: sanity check in follow_character_change
Browse files Browse the repository at this point in the history
  • Loading branch information
kpreid committed Jan 9, 2024
1 parent 94cb097 commit 0afb5e6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions test-renderers/src/test_cases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,15 +399,22 @@ async fn follow_character_change(context: RenderTestContext) {

// Draw the first character
renderer.update(None).await.unwrap();
let _ = renderer.draw("").await.unwrap();
let image1 = renderer.draw("").await.unwrap();

// It'd be surprising if this fails, but we should validate our premises.
assert_eq!(
image1.data[0],
[255, 0, 0, 255],
"Should be looking at c1 (red)"
);

// Switch characters and draw the second -- the resulting sky color should be from it
character_cell.set(Some(c2));
renderer.update(None).await.unwrap();
let image = renderer.draw("").await.unwrap();
let image2 = renderer.draw("").await.unwrap();

assert_eq!(
image.data[0],
image2.data[0],
[0, 255, 0, 255],
"Should be looking at c2 (green)"
);
Expand Down

0 comments on commit 0afb5e6

Please sign in to comment.