blob: 3ce808b61b071034830aab2de83e66b3164f3d28 (
plain)
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
|
use morphology_img::RenderError;
#[test]
fn test_error_display() {
let err = RenderError::LilyPondNotFound("test".to_string());
assert_eq!(err.to_string(), "LilyPond not found: test");
}
#[test]
fn test_lilypond_execution_error() {
let err = RenderError::LilyPondExecution("stderr output".to_string());
assert_eq!(err.to_string(), "LilyPond execution failed: stderr output");
}
#[test]
fn test_template_error() {
let err = RenderError::Template("missing placeholder".to_string());
assert_eq!(err.to_string(), "Template error: missing placeholder");
}
#[test]
fn test_invalid_sequence_error() {
let err = RenderError::InvalidSequence("empty sequence".to_string());
assert_eq!(err.to_string(), "Invalid sequence: empty sequence");
}
#[test]
fn test_io_error_conversion() {
let io_err = std::io::Error::new(std::io::ErrorKind::NotFound, "file not found");
let err: RenderError = io_err.into();
assert!(matches!(err, RenderError::FileIO(_)));
}
|