فهرست منبع

Update test_cleanup for testing a different expiry value

orhun 4 سال پیش
والد
کامیت
94a43a880d
1فایلهای تغییر یافته به همراه5 افزوده شده و 2 حذف شده
  1. 5 2
      rustpad-server/tests/cleanup.rs

+ 5 - 2
rustpad-server/tests/cleanup.rs

@@ -14,7 +14,10 @@ pub mod common;
 #[tokio::test]
 async fn test_cleanup() -> Result<()> {
     pretty_env_logger::try_init().ok();
-    let filter = server(ServerData::default());
+    let filter = server(ServerData {
+        expiry_days: 2,
+        ..ServerData::default()
+    });
 
     expect_text(&filter, "old", "").await;
 
@@ -39,7 +42,7 @@ async fn test_cleanup() -> Result<()> {
 
     let hour = Duration::from_secs(3600);
     time::pause();
-    time::advance(23 * hour).await;
+    time::advance(46 * hour).await;
     expect_text(&filter, "old", "hello").await;
 
     time::advance(3 * hour).await;