treemap: add more set tests
This commit is contained in:
parent
66afa5d17a
commit
2889a8a4e5
1 changed files with 10 additions and 0 deletions
|
@ -1131,6 +1131,11 @@ mod test_set {
|
|||
check(a, b, expected, |x, y, z| x.intersection(y, z))
|
||||
}
|
||||
|
||||
check_intersection([], [], []);
|
||||
check_intersection([1, 2, 3], [], []);
|
||||
check_intersection([], [1, 2, 3], []);
|
||||
check_intersection([2], [1, 2, 3], [2]);
|
||||
check_intersection([1, 2, 3], [2], [2]);
|
||||
check_intersection([11, 1, 3, 77, 103, 5, -5],
|
||||
[2, 11, 77, -9, -42, 5, 3],
|
||||
[3, 5, 11, 77]);
|
||||
|
@ -1160,6 +1165,9 @@ mod test_set {
|
|||
check(a, b, expected, |x, y, z| x.symmetric_difference(y, z))
|
||||
}
|
||||
|
||||
check_symmetric_difference([], [], []);
|
||||
check_symmetric_difference([1, 2, 3], [2], [1, 3]);
|
||||
check_symmetric_difference([2], [1, 2, 3], [1, 3]);
|
||||
check_symmetric_difference([1, 3, 5, 9, 11],
|
||||
[-2, 3, 9, 14, 22],
|
||||
[-2, 1, 5, 11, 14, 22]);
|
||||
|
@ -1172,6 +1180,8 @@ mod test_set {
|
|||
check(a, b, expected, |x, y, z| x.union(y, z))
|
||||
}
|
||||
|
||||
check_union([], [], []);
|
||||
check_union([1, 2, 3], [2], [1, 2, 3]);
|
||||
check_union([1, 3, 5, 9, 11, 16, 19, 24],
|
||||
[-2, 1, 5, 9, 13, 19],
|
||||
[-2, 1, 3, 5, 9, 11, 13, 16, 19, 24]);
|
||||
|
|
Loading…
Reference in a new issue