예제 #1
0
        public void Subtract(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> .Subtract(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 void Difference(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> .Difference(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());
        }
예제 #3
0
        public void Union(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> .Union(set1, set2).Expand());
            Assert.Equal(expected, new RangeSet <char>((IEnumerable <Range <char> >)(new[] { range1, range2 })).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());
        }
예제 #4
0
 public bool Equals(RangeSet <T> other)
 {
     return(RangeOperations <T> .Equals(this, other));
 }