Skip to content

Commit

Permalink
reduce the usage of Quranize::default
Browse files Browse the repository at this point in the history
  • Loading branch information
alpancs committed Mar 16, 2024
1 parent d393ad7 commit a71dc7b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/quranize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ impl Quranize {
/// # Examples
///
/// ```
/// let q = quranize::Quranize::default();
/// let q = quranize::Quranize::new(10);
/// assert_eq!(q.get_locations("بِسمِ").first(), Some(&(1, 1, 1)));
/// assert_eq!(q.get_locations("ن").first(), Some(&(68, 1, 1)));
/// ```
Expand Down Expand Up @@ -207,7 +207,7 @@ mod tests {

#[test]
fn test_quranize_default() {
let q = Quranize::default();
let q = Quranize::new(70);
assert_eq!(q.e("allah"), vec!["اللَّهَ", "اللَّهُ", "ءاللَّهُ", "اللَّهِ"]);
assert_eq!(q.e("illa billah"), vec!["إِلّا بِاللَّهِ"]);
assert_eq!(q.e("alquran"), vec!["القُرءانَ", "القُرءانُ", "القُرءانِ"]);
Expand Down Expand Up @@ -236,7 +236,7 @@ mod tests {

#[test]
fn test_first_aya() {
let q = Quranize::default();
let q = Quranize::new(70);
assert_eq!(q.e("alif lam mim"), vec!["الم"]);
assert_eq!(q.e("alif laaam miiim"), vec!["الم"]);
assert_eq!(q.e("nuun"), vec!["ن"]);
Expand All @@ -246,7 +246,7 @@ mod tests {

#[test]
fn test_alfatihah() {
let q = Quranize::default();
let q = Quranize::new(70);
assert_eq!(
q.e("bismillahirrohmanirrohiim"),
vec!["بِسمِ اللَّهِ الرَّحمٰنِ الرَّحيمِ"]
Expand All @@ -270,7 +270,7 @@ mod tests {

#[test]
fn test_al_ikhlas() {
let q = Quranize::default();
let q = Quranize::new(70);
assert_eq!(q.e("qulhuwallahuahad"), vec!["قُل هُوَ اللَّهُ أَحَدٌ"]);
assert_eq!(q.e("allahussomad"), vec!["اللَّهُ الصَّمَدُ"]);
assert_eq!(q.e("lam yalid walam yulad"), vec!["لَم يَلِد وَلَم يولَد"]);
Expand All @@ -282,7 +282,7 @@ mod tests {

#[test]
fn test_quranize_misc() {
let q = Quranize::default();
let q = Quranize::new(70);
assert_eq!(q.encode("bismillah")[0].1.len(), 13);
assert_eq!(q.encode("bismillah")[0].2, 3);
assert_eq!(q.encode("arrohman").len(), 3);
Expand Down Expand Up @@ -321,7 +321,7 @@ mod tests {

#[test]
fn test_locate() {
let q = Quranize::default();
let q = Quranize::new(70);
assert_eq!(q.get_locations("بِسمِ").first(), Some(&(1, 1, 1)));
assert_eq!(q.get_locations("وَالنّاسِ").last(), Some(&(114, 6, 3)));
assert_eq!(q.get_locations("بِسمِ اللَّهِ الرَّحمٰنِ الرَّحيمِ").len(), 2);
Expand Down

0 comments on commit a71dc7b

Please sign in to comment.