Skip to content

Commit b7e3d9d

Browse files
committed
Add a test to check the detected include path
1 parent d5f9e06 commit b7e3d9d

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/module.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,16 @@ mod tests {
366366
}
367367
}
368368

369+
fn path_options() -> Options {
370+
Options {
371+
comments: false,
372+
prefixes: true,
373+
examples: true,
374+
target_dir: "repo/modules/topic/".to_string(),
375+
detect_directory: true,
376+
}
377+
}
378+
369379
#[test]
370380
fn check_basic_assembly_fields() {
371381
let options = basic_options();
@@ -405,4 +415,20 @@ mod tests {
405415
.into();
406416
assert_eq!(from_new, from_builder);
407417
}
418+
419+
#[test]
420+
fn check_detected_path() {
421+
let options = path_options();
422+
423+
let module = Module::new(
424+
ModuleType::Procedure,
425+
"Testing the detected path",
426+
&options,
427+
);
428+
429+
assert_eq!(
430+
module.include_statement,
431+
"include::modules/topic/proc_testing-the-detected-path.adoc[leveloffset=+1]"
432+
);
433+
}
408434
}

0 commit comments

Comments
 (0)