From bfd906982b4168eac3a57bc6714fa4579bb2c999 Mon Sep 17 00:00:00 2001 From: Simon Van de Vyver Date: Fri, 25 Oct 2024 16:48:59 +0200 Subject: [PATCH] adapt tests to pass text not as reference --- sa-builder/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sa-builder/src/lib.rs b/sa-builder/src/lib.rs index 47a4aef..5cc8140 100644 --- a/sa-builder/src/lib.rs +++ b/sa-builder/src/lib.rs @@ -175,42 +175,42 @@ mod tests { #[test] fn test_build_ssa_libsais() { let mut text = b"ABRACADABRA$".to_vec(); - let sa = build_ssa(&mut text, &SAConstructionAlgorithm::LibSais, 1).unwrap(); + let sa = build_ssa(text, &SAConstructionAlgorithm::LibSais, 1).unwrap(); assert_eq!(sa, vec![11, 10, 7, 0, 3, 5, 8, 1, 4, 6, 9, 2]); } #[test] fn test_build_ssa_libsais_empty() { let mut text = b"".to_vec(); - let sa = build_ssa(&mut text, &SAConstructionAlgorithm::LibSais, 1).unwrap(); + let sa = build_ssa(text, &SAConstructionAlgorithm::LibSais, 1).unwrap(); assert_eq!(sa, vec![]); } #[test] fn test_build_ssa_libsais_sparse() { let mut text = b"ABRACADABRA$".to_vec(); - let sa = build_ssa(&mut text, &SAConstructionAlgorithm::LibSais, 2).unwrap(); + let sa = build_ssa(text, &SAConstructionAlgorithm::LibSais, 2).unwrap(); assert_eq!(sa, vec![10, 0, 8, 4, 6, 2]); } #[test] fn test_build_ssa_libdivsufsort() { let mut text = b"ABRACADABRA$".to_vec(); - let sa = build_ssa(&mut text, &SAConstructionAlgorithm::LibDivSufSort, 1).unwrap(); + let sa = build_ssa(text, &SAConstructionAlgorithm::LibDivSufSort, 1).unwrap(); assert_eq!(sa, vec![11, 10, 7, 0, 3, 5, 8, 1, 4, 6, 9, 2]); } #[test] fn test_build_ssa_libdivsufsort_empty() { let mut text = b"".to_vec(); - let sa = build_ssa(&mut text, &SAConstructionAlgorithm::LibDivSufSort, 1).unwrap(); + let sa = build_ssa(text, &SAConstructionAlgorithm::LibDivSufSort, 1).unwrap(); assert_eq!(sa, vec![]); } #[test] fn test_build_ssa_libdivsufsort_sparse() { let mut text = b"ABRACADABRA$".to_vec(); - let sa = build_ssa(&mut text, &SAConstructionAlgorithm::LibDivSufSort, 2).unwrap(); + let sa = build_ssa(text, &SAConstructionAlgorithm::LibDivSufSort, 2).unwrap(); assert_eq!(sa, vec![10, 0, 8, 4, 6, 2]); }