use aneubeck_daachorse::{CharwiseDoubleArrayAhoCorasick, CharwiseDoubleArrayAhoCorasickBuilder, MatchKind}; #[test] fn test_empty_pattern() { assert!(CharwiseDoubleArrayAhoCorasick::::new([""]).is_err()); } #[test] fn test_empty_set() { assert!(CharwiseDoubleArrayAhoCorasick::::new(Vec::::new()).is_err()); } #[test] fn test_duplicate_patterns() { assert!(CharwiseDoubleArrayAhoCorasick::::new(["abc", "123", "abc",]).is_err()); } #[test] fn test_empty_pattern_with_matchkind_leftmost_longest() { let pma: Result, _> = CharwiseDoubleArrayAhoCorasickBuilder::new() .match_kind(MatchKind::LeftmostLongest) .build([""]); assert!(pma.is_err()); } #[test] fn test_empty_set_with_matchkind_leftmost_longest() { let pma: Result, _> = CharwiseDoubleArrayAhoCorasickBuilder::new() .match_kind(MatchKind::LeftmostLongest) .build(Vec::::new()); assert!(pma.is_err()); } #[test] fn test_duplicate_patterns_with_matchkind_leftmost_longest() { let pma: Result, _> = CharwiseDoubleArrayAhoCorasickBuilder::new() .match_kind(MatchKind::LeftmostLongest) .build(["abc", "123", "abc"]); assert!(pma.is_err()); } #[test] fn test_empty_pattern_with_matchkind_leftmost_first() { let pma: Result, _> = CharwiseDoubleArrayAhoCorasickBuilder::new() .match_kind(MatchKind::LeftmostFirst) .build([""]); assert!(pma.is_err()); } #[test] fn test_empty_set_with_matchkind_leftmost_first() { let pma: Result, _> = CharwiseDoubleArrayAhoCorasickBuilder::new() .match_kind(MatchKind::LeftmostFirst) .build(Vec::::new()); assert!(pma.is_err()); } #[test] fn test_duplicate_patterns_with_matchkind_leftmost_first() { let pma: Result, _> = CharwiseDoubleArrayAhoCorasickBuilder::new() .match_kind(MatchKind::LeftmostFirst) .build(["abc", "123", "abc"]); assert!(pma.is_err()); } #[test] fn test_empty_pattern_with_matchkind_standard() { let pma: Result, _> = CharwiseDoubleArrayAhoCorasickBuilder::new() .match_kind(MatchKind::Standard) .build([""]); assert!(pma.is_err()); } #[test] fn test_empty_set_with_matchkind_standard() { let pma: Result, _> = CharwiseDoubleArrayAhoCorasickBuilder::new() .match_kind(MatchKind::Standard) .build(Vec::::new()); assert!(pma.is_err()); } #[test] fn test_duplicate_patterns_with_matchkind_standard() { let pma: Result, _> = CharwiseDoubleArrayAhoCorasickBuilder::new() .match_kind(MatchKind::Standard) .build(["abc", "123", "abc"]); assert!(pma.is_err()); }