@@ -262,10 +262,46 @@ mod tests {
262262 let result = run ( Some ( cmd) , & mut game) ;
263263
264264 assert ! ( result. is_err( ) ) ;
265+
265266 // game reset
266267 assert_eq ! ( game. player. max_hp( ) , game. player. current_hp) ;
267268 assert_eq ! ( 0 , game. gold) ;
268269 assert_eq ! ( 0 , game. player. xp) ;
270+ assert ! ( !game. tombstones. is_empty( ) ) ;
271+ }
272+
273+ #[ test]
274+ fn status_effect_dead ( ) {
275+ let mut game = Game :: new ( ) ;
276+
277+ // using force prevents battle but effects should apply anyway
278+ let cmd = Command :: ChangeDir {
279+ destination : "~/.." . to_string ( ) ,
280+ run : false ,
281+ bribe : false ,
282+ force : true ,
283+ } ;
284+
285+ // reduce stats to ensure loss
286+ let weak_class = character:: class:: Class {
287+ hp : character:: class:: Stat ( 1 , 1 ) ,
288+ speed : character:: class:: Stat ( 1 , 1 ) ,
289+ ..game. player . class
290+ } ;
291+ game. player = character:: Character :: new ( weak_class, 1 ) ;
292+ game. player . status_effect = Some ( character:: StatusEffect :: Burn ) ;
293+ game. gold = 100 ;
294+ game. player . xp = 100 ;
295+
296+ let result = run ( Some ( cmd) , & mut game) ;
297+
298+ assert ! ( result. is_err( ) ) ;
299+
300+ // game reset
301+ assert_eq ! ( game. player. max_hp( ) , game. player. current_hp) ;
302+ assert_eq ! ( 0 , game. gold) ;
303+ assert_eq ! ( 0 , game. player. xp) ;
304+ assert ! ( !game. tombstones. is_empty( ) ) ;
269305 }
270306
271307 #[ test]
0 commit comments