@@ -625,11 +625,6 @@ impl Selection {
626 // returns true if self ⊇ other
626 // returns true if self ⊇ other
627 pub fn contains(&self, other: &Selection) -> bool {
627 pub fn contains(&self, other: &Selection) -> bool {
628− // can't contain other if it is larger
629− if other.len() > self.len() {
633 let (mut iter_self, mut iter_other) = (self.iter(), other.iter());
628 let (mut iter_self, mut iter_other) = (self.iter(), other.iter());
634 let (mut ele_self, mut ele_other) = (iter_self.next(), iter_other.next());
629 let (mut ele_self, mut ele_other) = (iter_self.next(), iter_other.next());
@@ -1240,5 +1235,11 @@ mod test {
1240 vec!((3, 4), (7, 9))
1235 vec!((3, 4), (7, 9))
1242 assert!(!contains(vec!((1, 1), (5, 6)), vec!((1, 6))));
1237 assert!(!contains(vec!((1, 1), (5, 6)), vec!((1, 6))));
1239+ // multiple ranges of other are all contained in some ranges of self,
1241+ vec!((1, 4), (7, 10)),
1242+ vec!((1, 2), (3, 4), (7, 9))