mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-14 08:41:21 +10:00
Progress checker works
This commit is contained in:
17
src-tauri/src/tests/progress_tests.rs
Normal file
17
src-tauri/src/tests/progress_tests.rs
Normal file
@ -0,0 +1,17 @@
|
||||
use crate::downloads::progress::ProgressChecker;
|
||||
|
||||
#[test]
|
||||
fn test_progress_sequentially() {
|
||||
let p = ProgressChecker::new(Box::new(test_fn));
|
||||
p.run_contexts_sequentially((1..100).collect());
|
||||
println!("Progress: {}", p.get_progress_percentage(100));
|
||||
}
|
||||
#[test]
|
||||
fn test_progress_parallel() {
|
||||
let p = ProgressChecker::new(Box::new(test_fn));
|
||||
p.run_contexts_parallel((1..100).collect(), 10);
|
||||
}
|
||||
|
||||
fn test_fn(int: usize) {
|
||||
println!("{}", int);
|
||||
}
|
||||
Reference in New Issue
Block a user