From 6d89db211b0eb7dfa991b153ed588ccecc27a667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20GUEZO?= Date: Mon, 12 Jan 2026 22:15:21 +0100 Subject: [PATCH] chore(character.rs): add tests commit --- src/character.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/character.rs b/src/character.rs index e3e8cbc..cc9fa37 100644 --- a/src/character.rs +++ b/src/character.rs @@ -66,6 +66,7 @@ mod tests { use super::*; #[test] + /// Tests that a character is correctly initialized. fn character_build() { let c = Character::new(10, 5, 3, "test1"); assert_eq!(c.life, 10); @@ -75,6 +76,7 @@ mod tests { } #[test] + /// Tests that attacking reduces the target's life correctly. fn character_attack() { let mut c1 = Character::new(10, 3, 5, "test1"); let mut c2 = Character::new(10, 2, 5, "test2"); @@ -86,6 +88,7 @@ mod tests { } #[test] + /// Tests that consuming mana reduces it correctly. fn character_mana() { let mut c = Character::new(10, 3, 15, "test1"); c.consume_mana(10); @@ -93,6 +96,8 @@ mod tests { } #[test] + /// Tests method chaining: attack -> consume mana + /// -> attack. fn character_chaining() { let mut c1 = Character::new(10, 3, 15, "test1"); let mut c2 = Character::new(10, 2, 15, "test2");