예제 #1
0
        public void KleenStar_EmptyLanguage()
        {
            var element = ReFactory.NewKleeneStar(ReEmptyLanguage.Instance);

            Assert.That(element, Is.Not.Null);
            Assert.That(element, Is.TypeOf(typeof(ReEmptyLanguage)));
        }
예제 #2
0
        public void KleenStar_EmptyString()
        {
            var empty   = ReEmptyString.Instance;
            var element = ReFactory.NewKleeneStar(empty);

            Assert.That(element, Is.SameAs(empty));
        }
예제 #3
0
        public void KleeneStar_NestedKleenStar()
        {
            var child   = ReUtils.NewDummy('1');
            var subStar = new ReKleeneStar(child);

            var element = ReFactory.NewKleeneStar(subStar);

            Assert.That(element, Is.SameAs(subStar));
        }
예제 #4
0
        public void KleenStar_NonNested()
        {
            var child = ReUtils.NewDummy('1');

            var element = ReFactory.NewKleeneStar(child);

            Assert.That(element, Is.Not.Null);
            Assert.That(element, Is.TypeOf(typeof(ReKleeneStar)));

            var star = (ReKleeneStar)element;

            Assert.That(star.Element, Is.SameAs(child));
        }