Revert "[test] add tests for progress manager modes; verify bar counts and total bar visibility in single and multi modes"
This reverts commit 3dc1237938
.
This commit is contained in:
@@ -228,13 +228,6 @@ impl ProgressManager {
|
||||
Self::with_multi(mp, total as u64)
|
||||
}
|
||||
|
||||
/// Test helper: create a Single-mode manager with a hidden draw target, safe for tests
|
||||
/// even when not attached to a TTY.
|
||||
pub fn new_for_tests_single_hidden() -> Self {
|
||||
let mp = Arc::new(MultiProgress::with_draw_target(ProgressDrawTarget::hidden()));
|
||||
Self::with_single(mp)
|
||||
}
|
||||
|
||||
/// Backwards-compatible constructor used by older tests: same as new_for_tests_multi_hidden.
|
||||
pub fn test_new_multi(total: usize) -> Self {
|
||||
Self::new_for_tests_multi_hidden(total)
|
||||
@@ -248,23 +241,6 @@ impl ProgressManager {
|
||||
}
|
||||
}
|
||||
|
||||
/// Test helper: return the number of visible bars managed initially.
|
||||
/// Single mode: 3 (header, info, current). Multi mode: 4 (header, info, current, total).
|
||||
pub fn testing_bar_count(&self) -> usize {
|
||||
match &self.inner {
|
||||
ProgressInner::Noop => 0,
|
||||
ProgressInner::Single(_) => 3,
|
||||
ProgressInner::Multi(m) => {
|
||||
// Base bars always present
|
||||
let mut count = 4;
|
||||
// If per-file bars were initialized, include them as well
|
||||
if let Ok(files) = m.files.lock() { if let Some(v) = &*files { count += v.len(); } }
|
||||
if let Ok(t) = m.total_pct.lock() { if t.is_some() { count += 1; } }
|
||||
count
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Test helper: get state of the current item bar (position, length, finished, message).
|
||||
pub fn current_state_for_tests(&self) -> Option<(u64, u64, bool, String)> {
|
||||
match &self.inner {
|
||||
|
@@ -1,22 +0,0 @@
|
||||
use polyscribe::progress::ProgressManager;
|
||||
|
||||
#[test]
|
||||
fn test_single_mode_has_no_total_bar_and_three_bars() {
|
||||
// Use hidden backend suitable for tests
|
||||
let pm = ProgressManager::new_for_tests_single_hidden();
|
||||
// No total bar should be present
|
||||
assert!(pm.total_state_for_tests().is_none(), "single mode must not expose a total bar");
|
||||
// Bar count: header + info + current
|
||||
assert_eq!(pm.testing_bar_count(), 3);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_multi_mode_has_total_bar_and_four_bars() {
|
||||
let pm = ProgressManager::new_for_tests_multi_hidden(2);
|
||||
// Total bar should exist with the provided length
|
||||
let (pos, len) = pm.total_state_for_tests().expect("multi mode should expose total bar");
|
||||
assert_eq!(pos, 0);
|
||||
assert_eq!(len, 2);
|
||||
// Bar count: header + info + current + total
|
||||
assert_eq!(pm.testing_bar_count(), 4);
|
||||
}
|
Reference in New Issue
Block a user