Exemplo n.º 1
0
        public void Product5()
        {
            var uniformThenChar = StringDistribution.Any() + StringDistribution.Char('a');
            var charThenUniform = StringDistribution.Char('a') + StringDistribution.Any();
            var expectedProduct = StringDistribution.OneOf(
                StringDistribution.Char('a') + StringDistribution.Any() + StringDistribution.Char('a'),
                StringDistribution.Char('a'));

            StringInferenceTestUtilities.TestProduct(uniformThenChar, charThenUniform, expectedProduct, string.Empty, "a", "aba", "abaa", "abd");
        }
Exemplo n.º 2
0
 public void Product4()
 {
     StringInferenceTestUtilities.TestProduct(StringDistribution.Zero(), StringDistribution.OneOf("a", "c"), StringDistribution.Zero(), "a", "c", string.Empty);
     StringInferenceTestUtilities.TestProduct(StringDistribution.Zero(), StringDistribution.String("a"), StringDistribution.Zero(), "a", "c", string.Empty);
     StringInferenceTestUtilities.TestProduct(StringDistribution.OneOf("a", "c"), StringDistribution.Zero(), StringDistribution.Zero(), "a", "c", string.Empty);
     StringInferenceTestUtilities.TestProduct(StringDistribution.String("a"), StringDistribution.Zero(), StringDistribution.Zero(), "a", "c", string.Empty);
     StringInferenceTestUtilities.TestProduct(StringDistribution.Zero(), StringDistribution.Zero(), StringDistribution.Zero(), "a", "c", string.Empty);
     StringInferenceTestUtilities.TestProduct(StringDistribution.Zero(), StringDistribution.Any(), StringDistribution.Zero(), "a", "c", string.Empty);
     StringInferenceTestUtilities.TestProduct(StringDistribution.Any(), StringDistribution.Zero(), StringDistribution.Zero(), "a", "c", string.Empty);
 }
Exemplo n.º 3
0
        public void Product1()
        {
            var hello      = StringDistribution.String("hello");
            var world      = StringDistribution.String("world");
            var helloworld = StringDistribution.String("hello world");
            var subs       = StringDistribution.OneOf("hello", "world", "hello world");
            var any        = StringDistribution.Any();

            string[] interestingStrings = new[] { "hello", "world", "hello world", "hell", "ello", string.Empty };

            StringInferenceTestUtilities.TestProduct(subs, subs, subs, interestingStrings);
            StringInferenceTestUtilities.TestProduct(hello, any, hello, interestingStrings);
            StringInferenceTestUtilities.TestProduct(any, hello, hello, interestingStrings);
            StringInferenceTestUtilities.TestProduct(world, any, world, interestingStrings);
            StringInferenceTestUtilities.TestProduct(any, world, world, interestingStrings);
            StringInferenceTestUtilities.TestProduct(any, any, any, interestingStrings);
            StringInferenceTestUtilities.TestProduct(hello, world, StringDistribution.Zero());
            StringInferenceTestUtilities.TestProduct(helloworld, world, StringDistribution.Zero());
        }