added test for helper function

This commit is contained in:
2023-01-28 14:10:37 +01:00
parent 4c7c7c574d
commit a9eb073b55
3 changed files with 41 additions and 5 deletions

View File

@@ -0,0 +1,19 @@
use crate::app::builder::asciidoctor;
#[test]
fn last_matching_index_0() {
let vec1 = vec!["dings", "dings", "dingens"];
let vec2 = vec!["dings", "dings", "dings"];
let last_maching = asciidoctor::last_matching_index(&vec1, &vec2);
assert_eq!(last_maching, 1);
}
#[test]
fn last_matching_index_1() {
let vec1 = vec!["dings", "dings", "dingens", "dings", "dingens"];
let vec2 = vec!["dings", "dings", "dingens", "dings"];
let last_maching = asciidoctor::last_matching_index(&vec1, &vec2);
assert_eq!(last_maching, 3);
}

1
src/test/builder/mod.rs Normal file
View File

@@ -0,0 +1 @@
pub mod asciidoctor;