From e768d9dbd898e3dc11991a4553046ee61c22fe99 Mon Sep 17 00:00:00 2001 From: Abdelrahman Omar <128975938+abd0-omar@users.noreply.github.com> Date: Wed, 11 Sep 2024 12:37:23 +0300 Subject: [PATCH] add test coverage for IndexMut<&TicketId> (#142) --- exercises/06_ticket_management/14_index_mut/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/exercises/06_ticket_management/14_index_mut/src/lib.rs b/exercises/06_ticket_management/14_index_mut/src/lib.rs index a877f9d..fa39451 100644 --- a/exercises/06_ticket_management/14_index_mut/src/lib.rs +++ b/exercises/06_ticket_management/14_index_mut/src/lib.rs @@ -99,5 +99,11 @@ mod tests { let ticket = &store[id]; assert_eq!(ticket.status, Status::InProgress); + + let ticket = &mut store[&id]; + ticket.status = Status::Done; + + let ticket = &store[id]; + assert_eq!(ticket.status, Status::Done); } } -- 2.45.2