From 1c9377df6f1797804d2363b4c2f0e6498cc24e44 Mon Sep 17 00:00:00 2001 From: Vansh Nath Date: Sun, 6 Apr 2025 16:05:04 +0200 Subject: [PATCH] Add tests --- crates/nu-cli/src/completions/completion_options.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/nu-cli/src/completions/completion_options.rs b/crates/nu-cli/src/completions/completion_options.rs index 8d2716f2c4..b716d2edaa 100644 --- a/crates/nu-cli/src/completions/completion_options.rs +++ b/crates/nu-cli/src/completions/completion_options.rs @@ -313,6 +313,11 @@ mod test { #[case(MatchAlgorithm::Fuzzy, "example text", "ext", true)] #[case(MatchAlgorithm::Fuzzy, "example text", "mplxt", true)] #[case(MatchAlgorithm::Fuzzy, "example text", "mpp", false)] + #[case(MatchAlgorithm::Substring, "example text", "", true)] + #[case(MatchAlgorithm::Substring, "example text", "examp", true)] + #[case(MatchAlgorithm::Substring, "example text", "ple", true)] + #[case(MatchAlgorithm::Substring, "example text", "text", true)] + #[case(MatchAlgorithm::Substring, "example text", "mplxt", false)] fn match_algorithm_simple( #[case] match_algorithm: MatchAlgorithm, #[case] haystack: &str,