Skip to content

Commit

Permalink
add test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
alpancs committed Sep 21, 2024
1 parent 084c3a9 commit 4ca99b3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions quranize/src/suffix_tree/suffix_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,21 @@ mod tests {
assert_eq!(it.next(), Some((0, "x y")));
assert_eq!(it.next(), Some((2, "y")));
assert_eq!(it.next(), None);

let (_, suffixes): (Vec<_>, Vec<_>) =
suffix_iter("أُولٰئِكَ عَلىٰ هُدًى مِن رَبِّهِم ۖ وَأُولٰئِكَ هُمُ المُفلِحونَ\n").unzip();
assert_eq!(
suffixes,
[
"أُولٰئِكَ عَلىٰ هُدًى مِن رَبِّهِم ۖ وَأُولٰئِكَ هُمُ المُفلِحونَ\n",
"عَلىٰ هُدًى مِن رَبِّهِم ۖ وَأُولٰئِكَ هُمُ المُفلِحونَ\n",
"هُدًى مِن رَبِّهِم ۖ وَأُولٰئِكَ هُمُ المُفلِحونَ\n",
"مِن رَبِّهِم ۖ وَأُولٰئِكَ هُمُ المُفلِحونَ\n",
"رَبِّهِم ۖ وَأُولٰئِكَ هُمُ المُفلِحونَ\n",
"وَأُولٰئِكَ هُمُ المُفلِحونَ\n",
"هُمُ المُفلِحونَ\n",
"المُفلِحونَ\n",
]
);
}
}

0 comments on commit 4ca99b3

Please sign in to comment.