summaryrefslogtreecommitdiff
path: root/test/config.c
diff options
context:
space:
mode:
authorPhil Jones <philj56@gmail.com>2023-04-17 23:43:05 +0100
committerPhil Jones <philj56@gmail.com>2023-04-17 23:43:05 +0100
commit574eff0df1aff9bdc6d32939a03312cc08803de3 (patch)
tree5aeca72f70314bee3bf95db99f10d89f0a7b4032 /test/config.c
parent71a4801d20d8904cfcfa5e92c96d53ee06a2c69f (diff)
Add --matching-algorithm option.
This replaces the --fuzzy-match algorithm. Available choices are normal, prefix and fuzzy. Levenshtein distance was investigated, but it seems pretty rubbish for tofi's use case, where you normally want a good match when you've only typed a small portion of the target string.
Diffstat (limited to 'test/config.c')
-rw-r--r--test/config.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/config.c b/test/config.c
index 79f90e5..c15d66d 100644
--- a/test/config.c
+++ b/test/config.c
@@ -45,6 +45,12 @@ int main(int argc, char *argv[])
is_valid("text-cursor-style", "underscore", "Text cursor underscore");
isnt_valid("text-cursor-style", "blocky", "Invalid text cursor style");
+ /* Matching algorithms */
+ is_valid("matching-algorithm", "normal", "Normal matching");
+ is_valid("matching-algorithm", "fuzzy", "Fuzzy matching");
+ is_valid("matching-algorithm", "prefix", "Prefix matching");
+ isnt_valid("matching-algorithm", "regex", "Regex matching");
+
/* Bools */
is_valid("horizontal", "tRuE", "Boolean true");
is_valid("horizontal", "fAlSe", "Boolean false");