Update find matching test funcs.

When candidates are more than 1, look up to the dirnames and try to find best
matched file. In this way, we can take advantage of dirname based namespace
rules. If the best matched file is not clear, it behaves like it did.
`nth` is often much clearer than the likes of `cdar` and `cadar`.