mirror of
https://github.com/bloeys/nset.git
synced 2025-12-29 06:28:19 +00:00
UnionSets
This commit is contained in:
@ -67,6 +67,14 @@ func TestNSet(t *testing.T) {
|
||||
n7.Union(n6)
|
||||
|
||||
AllTrue(t, n6.ContainsAll(4, 7, 100, 1000), !n6.Contains(math.MaxUint32), n7.ContainsAll(4, 7, 100, 1000, math.MaxUint32), n7.StorageUnitCount == n7OldStorageUnitCount+n6.StorageUnitCount)
|
||||
|
||||
//UnionSets
|
||||
n7 = nset.NewNSet[uint32]()
|
||||
n7.AddMany(math.MaxUint32)
|
||||
|
||||
unionedSet := nset.UnionSets(n6, n7)
|
||||
AllTrue(t, !n6.Contains(math.MaxUint32), !n7.ContainsAny(4, 7, 100, 1000), unionedSet.ContainsAll(4, 7, 100, 1000, math.MaxUint32), unionedSet.StorageUnitCount == n6.StorageUnitCount+n7OldStorageUnitCount)
|
||||
|
||||
}
|
||||
|
||||
func TestNSetFullRange(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user