@@ -625,11 +625,6 @@ impl Selection {
625625
626626 // returns true if self ⊇ other
627627 pub fn contains(&self, other: &Selection) -> bool {
628− // can't contain other if it is larger
629− if other.len() > self.len() {
630− return false;
631− }
632−
633628 let (mut iter_self, mut iter_other) = (self.iter(), other.iter());
634629 let (mut ele_self, mut ele_other) = (iter_self.next(), iter_other.next());
635630
@@ -1240,5 +1235,11 @@ mod test {
12401235 vec!((3, 4), (7, 9))
12411236 ));
12421237 assert!(!contains(vec!((1, 1), (5, 6)), vec!((1, 6))));
1238+
1239+ // multiple ranges of other are all contained in some ranges of self,
1240+ assert!(contains(
1241+ vec!((1, 4), (7, 10)),
1242+ vec!((1, 2), (3, 4), (7, 9))
1243+ ));
12431244 }
12441245}