MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / test_background_task_cancellable

Function test_background_task_cancellable

rust/tests/background_task.rs:22–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20
21#[test]
22fn test_background_task_cancellable() {
23 let _session = Session::new().expect("Failed to initialize session");
24 let task_progress = "test cancellable";
25 let task = BackgroundTask::new(task_progress, false);
26 BackgroundTask::running_tasks()
27 .iter()
28 .find(|t| t.progress_text().as_str() == task_progress)
29 .expect("Task not running");
30 task.cancel();
31 assert!(task.is_cancelled());
32 task.finish();
33}
34
35#[test]
36fn test_background_task_progress() {

Callers

nothing calls this directly

Calls 6

findMethod · 0.80
as_strMethod · 0.80
progress_textMethod · 0.80
iterMethod · 0.45
cancelMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected