diff --git a/rust/tests/backgroundtask.rs b/rust/tests/backgroundtask.rs index a2466d657..d0c329e3c 100644 --- a/rust/tests/backgroundtask.rs +++ b/rust/tests/backgroundtask.rs @@ -10,25 +10,27 @@ fn session() -> Session { #[rstest] fn test_background_task_registered(_session: &Session) { - let task = BackgroundTask::new("test task", false); + let task_progress = "test registered"; + let task = BackgroundTask::new(task_progress, false); BackgroundTask::running_tasks() .iter() - .find(|t| t.progress_text().as_str() == "test task") + .find(|t| t.progress_text().as_str() == task_progress) .expect("Task not running"); task.finish(); let still_running = BackgroundTask::running_tasks() .iter() - .find(|t| t.progress_text().as_str() == "test task") + .find(|t| t.progress_text().as_str() == task_progress) .is_some(); assert!(!still_running, "Task still running"); } #[rstest] fn test_background_task_cancellable(_session: &Session) { - let task = BackgroundTask::new("test task", false); + let task_progress = "test cancellable"; + let task = BackgroundTask::new(task_progress, false); BackgroundTask::running_tasks() .iter() - .find(|t| t.progress_text().as_str() == "test task") + .find(|t| t.progress_text().as_str() == task_progress) .expect("Task not running"); task.cancel(); assert!(task.is_cancelled()); @@ -37,9 +39,9 @@ fn test_background_task_cancellable(_session: &Session) { #[rstest] fn test_background_task_progress(_session: &Session) { - let task = BackgroundTask::new("test task", false); + let task = BackgroundTask::new("test progress", false); let first_progress = task.progress_text().to_string(); - assert_eq!(first_progress, "test task"); + assert_eq!(first_progress, "test progress"); task.set_progress_text("new progress"); let second_progress = task.progress_text().to_string(); assert_eq!(second_progress, "new progress");