Esempio n. 1
0
        public void Many1Test()
        {
            Combinator.Many1(Parser.Fail <Char, Char>("Failure"))
            .Run("inputString".AsStream())
            .Case(
                failure: (restStream, _) => { /* OK */ },
                success: (restStream, _) => Assert.Fail());

            Combinator.Many1(Chars.Any())
            .Run("inputString".AsStream())
            .Case(
                failure: (restStream, _) => Assert.Fail(),
                success: (restStream, value) =>
            {
                Assert.True(Enumerable.SequenceEqual(value, "inputString"));
            });
        }