This looks for a
score property in suggestions from both Merino and remote
settings and picks the suggestion with the highest score. The score is intended
to be normalized -- i.e., in the range [0, 1] -- but currently it doesn't
matter. As discussed, I hardcoded a score of 0.2 for remote settings
When Merino returns multiple suggestions, currently we're just picking the first
one, but now we can pick the one with the highest score without any extra work,
so I went ahead and made sure we handle that now.
Also, this is robust against Merino not including a
score in the response. In
that case we'll prefer the remote settings suggestion if there is one, and we'll
use the Merino suggestion if there's not.
Finally I added some new test tasks that aren't specifically related to scoring:
testing cases where either Merino or remote settings returns suggestions but not
both. I noticed I missed those cases earlier.