Improved test code of SearchPresentationCompilerTest

This makes it easier to produce new tests and makes
them more robust (i.e. we don't have to pass the
location manually)

Fixes #1001687