Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alpancs committed Sep 22, 2024
1 parent abe9acc commit e172199
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/quranize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ impl Quranize {
///
/// ```
/// let q = quranize::Quranize::new(10);
/// assert_eq!(Some(&(0, 0)), q.find_str("بِسمِ").first());
/// assert!(q.find_str("بِسمِ").contains(&(0, 0)));
/// ```
pub fn find_str(&self, s: &str) -> Vec<Loc> {
self.st.find_str(s, 0)
Expand All @@ -189,7 +189,7 @@ mod tests {
#[test]
fn test_node_count() {
let q = Quranize::default();
assert_eq!(q.st.vertex_count(), 116_077);
assert_eq!(q.st.vertex_count(), 125_596);
}

#[test]
Expand Down Expand Up @@ -326,9 +326,9 @@ mod tests {
fn test_find_str() {
let q = Quranize::default();

assert_eq!(q.find_str("بِسمِ").first(), Some(&(0, 0)));
assert!(q.find_str("بِسمِ").contains(&(0, 0)));
assert_eq!(q.find_str("وَالنّاسِ").last(), Some(&(6235, 28)));
assert_eq!(q.find_str("الم").first(), Some(&(7, 0)));
assert!(q.find_str("الم").contains(&(7, 0)));
assert_eq!(q.find_str("بِسمِ اللَّهِ الرَّحمٰنِ الرَّحيمِ").len(), 2);
assert!(q.find_str("").is_empty());
assert!(q.find_str("نن").is_empty());
Expand Down
2 changes: 1 addition & 1 deletion src/quranize/suffix_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ mod tests {
t.construct(i, q);
}
// println!("{}", t.to_mermaid());
assert_eq!(t.edges.len(), 116_076);
assert_eq!(t.edges.len(), 125_595);
assert_eq!(t.vertices.len() - t.edges.len(), 1);
}

Expand Down

0 comments on commit e172199

Please sign in to comment.