diff options
author | curly <curlybryce@protonmail.com> | 2022-08-18 16:20:04 -0600 |
---|---|---|
committer | curly <curlybryce@protonmail.com> | 2022-08-18 16:20:04 -0600 |
commit | f0d5ddacfc97f0e88e3a7c445f890a76fabe47c7 (patch) | |
tree | a742ed8bb1dfa11acb77137d5be842cbcc4de674 /src/tetris/piece.rs | |
parent | 0eae9046860bf1b382f57956493335491279d182 (diff) | |
download | tetris-f0d5ddacfc97f0e88e3a7c445f890a76fabe47c7.tar.gz tetris-f0d5ddacfc97f0e88e3a7c445f890a76fabe47c7.tar.bz2 tetris-f0d5ddacfc97f0e88e3a7c445f890a76fabe47c7.zip |
touch ups
Diffstat (limited to 'src/tetris/piece.rs')
-rw-r--r-- | src/tetris/piece.rs | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/tetris/piece.rs b/src/tetris/piece.rs index 6454ab5..19e8e6c 100644 --- a/src/tetris/piece.rs +++ b/src/tetris/piece.rs @@ -326,48 +326,4 @@ impl Piece { } } } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn apply_down() { - let mut p = Piece::random(Pos(0,0)); - let d = Dir::Down; - p.apply_dir(&d); - - if p.get_pos() != Pos(1,0) { - panic!("{:?} did not move down properly", p.get_pos()) - } - } - - #[test] - fn hit_test() { - let mut p = Piece::random(Pos(30,0)); - let d = Dir::Down; - - let tetris = Tetris::new(); - - p.r#move(d, &tetris); - - if p.is_alive() != false { - panic!("Piece did not die, is_alive == {}", p.is_alive()) - } - - } - #[test] - fn hit_nothing_test() { - let mut p = Piece::random(Pos(0,0)); - let d = Dir::Down; - - let tetris = Tetris::new(); - - p.r#move(d, &tetris); - - if p.is_alive() == false { - panic!("Piece died, is_alive == {}", p.is_alive()) - } - } }
\ No newline at end of file |