about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2013-03-10 20:41:50 -0400
committerDaniel Micay <danielmicay@gmail.com>2013-03-11 22:36:23 -0400
commit2889a8a4e5a490cf650d3730bc05a1694a1d3310 (patch)
treecb590f505e0fef7c30f0dfb9b6cc24f596825ce4 /src
parent66afa5d17a0d157de38e749851ed75b48f8fc3c4 (diff)
treemap: add more set tests
Diffstat (limited to 'src')
-rw-r--r--src/libstd/treemap.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libstd/treemap.rs b/src/libstd/treemap.rs
index 6126be09bbe..28ed95a0978 100644
--- a/src/libstd/treemap.rs
+++ b/src/libstd/treemap.rs
@@ -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]);