Add helpers for sorting slot/plug/connection refs.
Allows external packages to sort their collections without the necessity to
implement the actual ordering logic. Instead, it should be possible to directly
plug provided helpers into sort.Interface.Less().
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Allow adding slots/plugs from snaps with instance keys. Extend unit tests to
cover parallel instances of snaps.
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
This patch improves sort code (some silly copy-pasted, harmless but
needleess code is now removed) and adds full test coverage. Tests are
also in a _test package and are no longer polutting the main namespace.
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>