diff options
Diffstat (limited to 'morphology-img/tests/config.rs')
| -rw-r--r-- | morphology-img/tests/config.rs | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/morphology-img/tests/config.rs b/morphology-img/tests/config.rs index 6302cb0..7cc71cb 100644 --- a/morphology-img/tests/config.rs +++ b/morphology-img/tests/config.rs @@ -240,3 +240,59 @@ fn test_max_batch_size_field_is_public() { let _batch_size = config.max_batch_size; assert_eq!(_batch_size, Some(15)); } + +#[test] +fn test_default_parallel_is_false() { + let config = RenderConfig::default(); + assert!(!config.parallel); +} + +#[test] +fn test_builder_parallel_true() { + let config = RenderConfig::new("output") + .parallel(true); + + assert!(config.parallel); + assert_eq!(config.output_dir, PathBuf::from("output")); +} + +#[test] +fn test_builder_parallel_false() { + let config = RenderConfig::new("output") + .parallel(false); + + assert!(!config.parallel); +} + +#[test] +fn test_builder_parallel_overwrites() { + let config = RenderConfig::new("output") + .parallel(true) + .parallel(false); // Override previous value + + assert!(!config.parallel); +} + +#[test] +fn test_builder_with_all_options_including_parallel() { + let config = RenderConfig::new("my-output") + .keep_temp_files(true) + .lilypond_binary("/usr/bin/lilypond") + .max_batch_size(25) + .parallel(true); + + assert_eq!(config.output_dir, PathBuf::from("my-output")); + assert!(config.keep_temp_files); + assert_eq!(config.lilypond_binary, PathBuf::from("/usr/bin/lilypond")); + assert_eq!(config.max_batch_size, Some(25)); + assert!(config.parallel); +} + +#[test] +fn test_parallel_field_is_public() { + let config = RenderConfig::new("output").parallel(true); + + // Should be able to access field directly + let _parallel = config.parallel; + assert!(_parallel); +} |