mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-18 01:13:30 -05:00
fix: suggest the nearest system or emulator name
This commit is contained in:
1 parent
c1c3808e1e
commit
feb3b03a39
4 files changed
+33
-9
No files matched your search
@@ -163,5 +163,17 @@ class ExclusionNotesListedOnAsk(unittest.TestCase):
|
||||
self.assertRegex(verbose, r"No external files \(\d+\):")
|
||||
self.assertLess(len(plain.splitlines()), len(verbose.splitlines()))
|
||||
|
||||
|
||||
class ATypoGetsTheNearestNames(unittest.TestCase):
|
||||
"""The hint listed the first names of the alphabet behind "...":
|
||||
sony-playstaton was answered with 3do to apple-iie."""
|
||||
|
||||
def test_suggestions_follow_the_typed_name(self):
|
||||
hint = common.suggest_names(["sony-playstaton"],
|
||||
["3do", "apple-ii", "sony-playstation"], "--list-systems")
|
||||
self.assertEqual(hint, "Did you mean: sony-playstation? --list-systems lists all 3.")
|
||||
self.assertEqual(common.suggest_names(["zzz"], ["3do"], "--list-systems"),
|
||||
"--list-systems lists all 1.")
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user