Antlr4.Runtime.Test.TestIntervalSet.TestNotSetFragmentedVocabulary C# (CSharp) Method

TestNotSetFragmentedVocabulary() private method

private TestNotSetFragmentedVocabulary ( ) : void
return void
        public void TestNotSetFragmentedVocabulary()
        {
            IntervalSet vocabulary = IntervalSet.Of(1, 255);
            vocabulary.Add(1000, 2000);
            vocabulary.Add(9999);
            IntervalSet s = IntervalSet.Of(50, 60);
            s.Add(3);
            s.Add(250, 300);
            s.Add(10000); // this is outside range of vocab and should be ignored
            String expecting = "{1..2, 4..49, 61..249, 1000..2000, 9999}";
            String result = (s.Complement(vocabulary)).ToString();
            Assert.AreEqual(expecting, result);
        }