From a4379bbd8b01bc082ee93e5cad3a1ccda8a0cdd0 Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Fri, 22 Dec 2023 09:35:20 +0100 Subject: [PATCH] update test --- tests/tests.rs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/tests/tests.rs b/tests/tests.rs index d339a91..b1d0447 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -435,13 +435,30 @@ fn try_update_with_not_contains() { #[test] fn try_update_with_failure_does_not_delete_element() { let mut sut = Users::new(); + sut.append(User::new(1, "Blob.")); sut.append(User::new(2, "Blob, Jr.")); - assert_eq!(sut.items(), [User::new(2, "Blob, Jr.")]); + sut.append(User::new(3, "Blob, Sr.")); + + assert_eq!( + sut.items(), + [ + User::new(1, "Blob."), + User::new(2, "Blob, Jr."), + User::new(3, "Blob, Sr.") + ] + ); assert_eq!(sut.try_update_with(&2, |_| { Err(false) }), Err(false)); // remains unchanged - assert_eq!(sut.items(), [User::new(2, "Blob, Jr.")]); + assert_eq!( + sut.items(), + [ + User::new(1, "Blob."), + User::new(2, "Blob, Jr."), + User::new(3, "Blob, Sr.") + ] + ); } #[test]