aboutsummaryrefslogtreecommitdiff
path: root/src/tetris
diff options
context:
space:
mode:
Diffstat (limited to 'src/tetris')
-rw-r--r--src/tetris/piece.rs44
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