mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-09 10:07:58 -06:00
tests: revamp tests, remove more useless tests
This commit is contained in:
@@ -12,40 +12,37 @@ fn mock_atlas_tile(id: u32) -> AtlasTile {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_tick_multiple_blink_changes() {
|
||||
fn test_blinking_texture() {
|
||||
let tile = mock_atlas_tile(1);
|
||||
let mut texture = BlinkingTexture::new(tile, 0.5);
|
||||
|
||||
// First blink
|
||||
assert_eq!(texture.is_on(), true);
|
||||
|
||||
texture.tick(0.5);
|
||||
assert_eq!(texture.is_on(), false);
|
||||
|
||||
// Second blink (back to on)
|
||||
texture.tick(0.5);
|
||||
assert_eq!(texture.is_on(), true);
|
||||
|
||||
// Third blink (back to off)
|
||||
texture.tick(0.5);
|
||||
assert_eq!(texture.is_on(), false);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_tick_partial_blink_duration() {
|
||||
fn test_blinking_texture_partial_duration() {
|
||||
let tile = mock_atlas_tile(1);
|
||||
let mut texture = BlinkingTexture::new(tile, 0.5);
|
||||
|
||||
// Tick with 1.25 blink durations
|
||||
texture.tick(0.625);
|
||||
assert_eq!(texture.is_on(), false);
|
||||
assert_eq!(texture.time_bank(), 0.125);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_tick_with_negative_delta_time() {
|
||||
fn test_blinking_texture_negative_time() {
|
||||
let tile = mock_atlas_tile(1);
|
||||
let mut texture = BlinkingTexture::new(tile, 0.5);
|
||||
|
||||
// Should not cause issues
|
||||
texture.tick(-0.1);
|
||||
assert_eq!(texture.is_on(), true);
|
||||
assert_eq!(texture.time_bank(), -0.1);
|
||||
|
||||
Reference in New Issue
Block a user