From 780e8d255a44fee015aac0fee0194c5904968582 Mon Sep 17 00:00:00 2001 From: Vincent Ruello <5345986+vruello@users.noreply.github.com> Date: Sat, 26 Oct 2024 17:22:28 +0200 Subject: [PATCH] Use max_elements in database tests --- common/src/database/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/src/database/mod.rs b/common/src/database/mod.rs index a4315de..26a340c 100644 --- a/common/src/database/mod.rs +++ b/common/src/database/mod.rs @@ -174,6 +174,7 @@ pub mod tests { assert_eq!(toto.revision(), None); assert_eq!(toto.data_locale(), None); assert_eq!(toto.locale(), None); + assert_eq!(toto.max_elements(), None); let toto2 = db.get_subscription_by_identifier("toto").await?.unwrap(); assert_eq!(toto, &toto2); @@ -211,7 +212,8 @@ pub mod tests { ]) .set_revision(Some("1472".to_string())) .set_locale(Some("fr-FR".to_string())) - .set_data_locale(Some("en-US".to_string())); + .set_data_locale(Some("en-US".to_string())) + .set_max_elements(Some(10)); db.store_subscription(&subscription2).await?; assert!(db.get_subscriptions().await?.len() == 2); @@ -256,6 +258,7 @@ pub mod tests { assert_eq!(tata.revision(), Some("1472".to_string()).as_ref()); assert_eq!(tata.locale(), Some("fr-FR".to_string()).as_ref()); assert_eq!(tata.data_locale(), Some("en-US".to_string()).as_ref()); + assert_eq!(tata.max_elements(), Some(10)); let tata_save = tata.clone(); tata.set_name("titi".to_string())