Пример #1
0
        public void Intersect(char[] expected, char from1, char to1, char from2, char to2)
        {
            var range1 = Range <char> .Create(from1, to1);

            RangeSet <char> set1   = range1;
            var             range2 = Range <char> .Create(from2, to2);

            RangeSet <char> set2 = range2;

            Assert.Equal(expected, RangeOperations <char> .Intersection(set1, set2).Expand());
            Assert.Equal(expected, (set1 & set2).Expand());
            Assert.Equal(expected, (range1 & range2).Expand());
            Assert.Equal(expected, (set1 & range2).Expand());
            Assert.Equal(expected, (range1 & set2).Expand());
        }
Пример #2
0
 public static RangeSet <T> operator &(RangeSet <T> left, RangeSet <T> right)
 {
     return(RangeOperations <T> .Intersection(left, right));
 }