internal/tdtest: make function detection more robust
Instead of detecting the package (which was already brittle),
test the first argument of the closure of the second argument of
Run. This allows other packages to wrap the tdtest.Run function,
as long as they keep the same signature.
This is necessary to handle errors in cuetest.Run.
Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: If8dea69244fec9111916df667b0a8c09dc85fa4d
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1167818
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>