internal/cuetxtar: add method for getting a single instance
This CL renames `Test.ValidInstances` to just `Instances`. There doesn't
seem much to be gained from the "Valid" prefix: functions
only return valid results and we've already got the "Raw" prefix
to distinguish the two methods.
Currently the `ValidInstances` method is used in many places
to get just the single instance at the top level of the txtar archive,
but this is somewhat opaque as it relies on the implicit behaviour
that passing no arguments implies the single package in the
top level directory. This CL adds an `Instance` method to return just a single instance.
Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I4d48697159cf200a3d6b2f2eda2a260b7922fd33
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/541050
Reviewed-by: Paul Jolly <paul@myitcv.io>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUEcueckoo <cueckoo@cuelang.org>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>