1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
use vika_cli::progress::ProgressReporter;
#[test]
fn test_progress_reporter_new_non_verbose() {
let reporter = ProgressReporter::new(false);
// Test passes if reporter is successfully created
reporter.success("Test");
}
#[test]
fn test_progress_reporter_new_verbose() {
let reporter = ProgressReporter::new(true);
// Test passes if reporter is successfully created
reporter.success("Test");
}
#[test]
fn test_start_and_finish_spinner_verbose() {
let mut reporter = ProgressReporter::new(true);
reporter.start_spinner("Test message");
reporter.finish_spinner("Done");
// Should not panic
}
#[test]
fn test_start_and_finish_spinner_non_verbose() {
let mut reporter = ProgressReporter::new(false);
reporter.start_spinner("Test");
reporter.finish_spinner("Done");
// Should not panic
}
#[test]
fn test_info_verbose() {
let reporter = ProgressReporter::new(true);
reporter.info("Test info");
// Should not panic
}
#[test]
fn test_info_non_verbose() {
let reporter = ProgressReporter::new(false);
reporter.info("Test info");
// Should not panic (doesn't print in non-verbose)
}
#[test]
fn test_success() {
let reporter = ProgressReporter::new(false);
reporter.success("Test success");
// Should not panic
}
#[test]
fn test_warning() {
let reporter = ProgressReporter::new(false);
reporter.warning("Test warning");
// Should not panic
}
#[test]
fn test_error() {
let reporter = ProgressReporter::new(false);
reporter.error("Test error");
// Should not panic
}
#[test]
fn test_drop_with_spinner() {
let mut reporter = ProgressReporter::new(false);
reporter.start_spinner("Test");
// Dropping reporter should clean up spinner
drop(reporter);
// Test passes if no panic
}
#[test]
fn test_multiple_spinner_operations() {
let mut reporter = ProgressReporter::new(false);
reporter.start_spinner("Operation 1");
reporter.finish_spinner("Done 1");
reporter.start_spinner("Operation 2");
reporter.finish_spinner("Done 2");
// Should handle multiple start/finish cycles
}
#[test]
fn test_all_message_types() {
let reporter = ProgressReporter::new(true);
reporter.info("Info message");
reporter.success("Success message");
reporter.warning("Warning message");
reporter.error("Error message");
// Should handle all message types
}