add test coverage for IndexMut<&TicketId> (#142)
authorAbdelrahman Omar <128975938+abd0-omar@users.noreply.github.com>
Wed, 11 Sep 2024 09:37:23 +0000 (12:37 +0300)
committerGitHub <noreply@github.com>
Wed, 11 Sep 2024 09:37:23 +0000 (11:37 +0200)
exercises/06_ticket_management/14_index_mut/src/lib.rs

index a877f9d..fa39451 100644 (file)
@@ -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);
     }
 }