Feedback from https://github.com/kubernetes/utils/pull/267 and related
reviews.
* Equality when insertion order is different
* UnsortedList contents
* Not-Subset cases
* Clone coverage
All usage of builder pattern is convertible to cpuset.New()
with the same or fewer lines of code.
Migrate Builder.Add to a private method of CPUSet, with a comment
that it is only intended for internal use to preserve immutable
propoerty of the exported interface.
This also removes 'require' library dependency, which avoids
non-standard library usage.
In 'set', conversions to slice are done also, but with different names:
ToSliceNoSort() -> UnsortedList()
ToSlice() -> List()
Reimplement List() in terms of UnsortedList to save some duplication.
The cpuset.Parse function missed a couple bad input cases, specifically
"1--3" and "10-6". These were silently ignored when they should instead
be flagged as invalid.
This now catches these cases and expands the unit tests for cpuset to
cover them (and other negative test cases as well).
Signed-off-by: Jim Ramsay <jramsay@redhat.com>