Repository: clap-rs/clap (language: rust)

Issue:
[DEV] Typo in test prevents all `suggestions.rs` unit tests from running (incidentally all failing)
### Please complete the following tasks

- [X] I have searched the [discussions](https://github.com/clap-rs/clap/discussions)
- [X] I have searched the [open](https://github.com/clap-rs/clap/issues) and [rejected](https://github.com/clap-rs/clap/issues?q=is%3Aissue+label%3AS-wont-fix+is%3Aclosed) issues

### Rust Version

rustc 1.66.0 (69f9c33d7 2022-12-12)

### Clap Version

master

### Minimal reproducible code

None necessary

### Steps to reproduce the bug with the above code

Change a unit test in `suggestion.rs` so that it should fail and observe that it doesn't fail because it's not run (rust-analyzer also tells you that in VScode)

See https://github.com/clap-rs/clap/blob/9f4f341604266b82d50b6b71999962585c11b40f/src/parser/features/suggestions.rs#L75

### Actual Behaviour

Tests should run

### Expected Behaviour

Tests don't run

### Additional Context

Reason: it seems that this is due to a typo:

This:
```rs
#[cfg(all(test, feature = "suggestions"))]
```
https://github.com/clap-rs/clap/blob/9f4f341604266b82d50b6b71999962585c11b40f/src/parser/features/suggestions.rs#L75

should read
```rs
#[cfg(all(test, feature = "suggestion"))]
```

Instead, so `feature` instead of `features`. See: https://doc.rust-lang.org/cargo/reference/features.html for reference


### Debug Output

_No response_


Discussion / hints:

Fix patch:
diff --git a/src/parser/features/suggestions.rs b/src/parser/features/suggestions.rs
index f0aa5026ebb..990ec026692 100644
--- a/src/parser/features/suggestions.rs
+++ b/src/parser/features/suggestions.rs
@@ -72,34 +72,88 @@ where
     }
 }
 
-#[cfg(all(test, features = "suggestions"))]
+#[cfg(all(test, feature = "suggestions"))]
 mod test {
     use super::*;
 
     #[test]
-    fn possible_values_match() {
+    fn missing_letter() {
         let p_vals = ["test", "possible", "values"];
-        assert_eq!(did_you_mean("tst", p_vals.iter()), Some("test"));
+        assert_eq!(did_you_mean("tst", p_vals.iter()), vec!["test".to_owned()]);
     }
 
     #[test]
-    fn possible_values_match() {
-        let p_vals = ["test", "temp"];
-        assert_eq!(did_you_mean("te", p_vals.iter()), Some("test"));
+    fn ambiguous() {
+        let p_vals = ["test", "temp", "possible", "values"];
+        assert_eq!(
+            did_you_mean("te", p_vals.iter()),
+            vec!["test".to_owned(), "temp".to_owned()]
+        );
     }
 
     #[test]
-    fn possible_values_nomatch() {
+    fn unrelated() {
         let p_vals = ["test", "possible", "values"];
-        assert!(did_you_mean("hahaahahah", p_vals.iter()).is_none());
+        assert_eq!(
+            did_you_mean("hahaahahah", p_vals.iter()),
+            Vec::<String>::new()
+        );
     }
 
     #[test]
-    fn flag() {
+    fn best_fit() {
+        let p_vals = [
+            "test",
+            "possible",
+            "values",
+            "alignmentStart",
+            "alignmentScore",
+        ];
+        assert_eq!(
+            did_you_mean("alignmentScorr", p_vals.iter()),
+            vec!["alignmentStart".to_owned(), "alignmentScore".to_owned()]
+        );
+    }
+
+    #[test]
+    fn flag_missing_letter() {
         let p_vals = ["test", "possible", "values"];
         assert_eq!(
-            did_you_mean_flag("tst", p_vals.iter(), []),
-            Some(("test", None))
+            did_you_mean_flag("tst", &[], p_vals.iter(), []),
+            Some(("test".to_owned(), None))
+        );
+    }
+
+    #[test]
+    fn flag_ambiguous() {
+        let p_vals = ["test", "temp", "possible", "values"];
+        assert_eq!(
+            did_you_mean_flag("te", &[], p_vals.iter(), []),
+            Some(("temp".to_owned(), None))
+        );
+    }
+
+    #[test]
+    fn flag_unrelated() {
+        let p_vals = ["test", "possible", "values"];
+        assert_eq!(
+            did_you_mean_flag("hahaahahah", &[], p_vals.iter(), []),
+            None
+        );
+    }
+
+    #[test]
+    fn flag_best_fit() {
+        let p_vals = [
+            "test",
+            "possible",
+            "values",
+            "alignmentStart",
+            "alignmentScore",
+        ];
+        assert_eq!(
+            did_you_mean_flag("alignmentScorr", &[], p_vals.iter(), []),
+            Some(("alignmentScore".to_owned(), None))
         );
     }
 }


Test patch: