Exemple #1
0
        public void TestConcatNotEmpty()
        {
            var expected = new ConcatRegex <int>(new ConcatRegex <int>(1.ToRegex(), 2.ToRegex()), 3.ToRegex());
            var actual   = RegexUtils.Concat(1.ToRegex(), 2.ToRegex(), 3.ToRegex());

            Assert.AreEqual(expected, actual);
        }
Exemple #2
0
        public void TestConcatEmpty()
        {
            var expected = new EpsilonRegex <int>();
            var actual   = RegexUtils.Concat <int>();

            Assert.AreEqual(expected, actual);
        }
Exemple #3
0
        public void TestCreateList()
        {
            var expected = new SumRegex <int>(
                new EpsilonRegex <int>(),
                RegexUtils.Concat(123.ToRegex(), RegexUtils.Concat(0.ToRegex(), 123.ToRegex()).Starred()));
            var actual = RegexUtils.SeparatedBy(123.ToRegex(), 0.ToRegex());

            Assert.AreEqual(expected, actual);
        }