Ejemplo n.º 1
0
        public void GetLanguageEmptyTest()
        {
            RegExp             regExp   = new RegExp("a");
            SortedSet <string> language = regExp.GetLanguage(0);

            Assert.AreEqual(0, language.Count);
        }
Ejemplo n.º 2
0
        public void GetLanguageDotTest()
        {
            RegExp             regExp   = new RegExp("a").Dot(new RegExp("b"));
            SortedSet <string> language = regExp.GetLanguage(2);

            Assert.AreEqual(1, language.Count);
            Assert.AreEqual("ab", language.ToList()[0]);
        }
Ejemplo n.º 3
0
        public void GetLanguagePlusTest()
        {
            RegExp             regExp   = new RegExp("a").Plus();
            SortedSet <string> language = regExp.GetLanguage(2);

            Assert.AreEqual(2, language.Count);
            Assert.AreEqual("a", language.ToList()[0]);
            Assert.AreEqual("aa", language.ToList()[1]);
        }
Ejemplo n.º 4
0
        public void GetLanguageStarTest()
        {
            RegExp             regExp   = new RegExp("a").Star();
            SortedSet <string> language = regExp.GetLanguage(2);

            Assert.AreEqual(3, language.Count);
            Assert.AreEqual("", language.ToList()[0]);
            Assert.AreEqual("a", language.ToList()[1]);
            Assert.AreEqual("aa", language.ToList()[2]);
        }