Skip to content

Commit adec85f

Browse files
added test_recursive_config
1 parent 2adc245 commit adec85f

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/config.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,6 @@ mod tests {
509509
}
510510
#[test]
511511
fn test_parse_hyprlang() {
512-
println!("{}", &open_conf("./test_configs/test_hyprlang.conf"));
513512
let (_, scratchpads) =
514513
parse_hyprlang(&open_conf("./test_configs/test_hyprlang.conf")).unwrap();
515514
assert_eq!(scratchpads, expected_scratchpads());
@@ -529,6 +528,23 @@ mod tests {
529528
assert_eq!(scratchpads, expected_scratchpads);
530529
}
531530

531+
#[test]
532+
fn test_recursive_config() {
533+
let (_, scratchpads) = parse_config(
534+
&open_conf("./test_configs/test_nested/config_main.txt"),
535+
Path::new("./test_configs/test_nested"),
536+
)
537+
.unwrap();
538+
539+
let mut expected_scratchpads = vec![];
540+
for i in 1..=11 {
541+
let title = format!("scratch{i}");
542+
expected_scratchpads.push(Scratchpad::new(&title, &title, "noop", ""))
543+
}
544+
545+
assert_eq!(scratchpads, expected_scratchpads);
546+
}
547+
532548
struct ReloadResources {
533549
config_contents_a: &'static [u8],
534550
config_contents_b: &'static [u8],

0 commit comments

Comments
 (0)