bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#42149: Substring and flex completion ignore implicit trailing ‘any’


From: João Távora
Subject: bug#42149: Substring and flex completion ignore implicit trailing ‘any’
Date: Mon, 28 Dec 2020 16:58:30 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> This is one of them.
>>
>>     (ert-deftest completion-pcm-test-3 ()
>>       ;; Full match!
>>       (should (eql
>>                (completion--pcm-score
>>                 (car (completion-pcm-all-completions
>>                       "R" '("R" "hello") nil 1)))
>>                1.0)))
>
> BTW, a good improvement to the tests would be to replace the score
> equality tests with score ordering comparisons (like "score of foo >
> score of bar") since it'd be perfectly OK to use a different scoring
> system which gives different values as long as the relative ordering is
> still obeyed.

I'm not so sure I agree.  I mean, I agree with the general principle,
but I also think in our particular algorithm we can make some simple
guarantees about the absolute value of the computed score in such
trivial situations.  In this case, Dario's test asserts that a full and
perfect match has a score of 1 (hundred percent).  So the test is only
brittle if we break down this pillar, and I don't think we should.  At
least I don't think we have good reason to.

João






reply via email to

[Prev in Thread] Current Thread [Next in Thread]