Provides a member generator for regexes
        //[TestMethod]
        public void TestMinimizationOfSFAs()
        {
            var auts = new List<Automaton<BDD>>();
            var rex = new Rex.RexEngine(BitWidth.BV16);
            foreach (var file in Directory.EnumerateFiles("c:/Automata/brics/dfas/"))
            {
                var aut = Automata.Internal.Utilities.RegexToRangeAutomatonSerializer.Read(rex.Solver, file);
                auts.Add(aut);
            }

            int t = System.Environment.TickCount;
            foreach (var aut in auts)
                rex.Minimize(aut);
            t = System.Environment.TickCount - t;
            Console.WriteLine(t);
        }
Example #2
0
        public void TestSampleRegexesInMultilineMode()
        {
            Rex.RexEngine rex = new Rex.RexEngine(BitWidth.BV16);
            string[] regexes = File.ReadAllLines(regexesFile);
            List<int> exclude = new List<int>();

            int rxCount = 100; //number of strings to be generated for each regex
            for (int i = 1; i < regexes.Length; i++)
                foreach (string s in rex.GenerateMembers(RegexOptions.Multiline, rxCount, regexes[i]))
                    //if (!exclude.Contains(i))
                    Assert.IsTrue(Rex.RexEngine.IsMatch(s, regexes[i], RegexOptions.Multiline), "regex on line " + i + " in Samples/regexes.txt");
        }