Beispiel #1
0
        public void ShouldMatch()
        {
            TerminalInput input;


            input = new TerminalInput(new Token("C", "V"));

            Assert.IsTrue(input.Match(new Token("C", "V")));
            Assert.IsTrue(input.Match(new TerminalInput(new Token("C", "V"))));
        }
Beispiel #2
0
        public void ShouldMatch()
        {
            TerminalInput input;


            input = new TerminalInput('a');

            Assert.IsTrue(input.Match('a'));
            Assert.IsTrue(input.Match(new TerminalInput('a')));
        }
Beispiel #3
0
        public void ShouldNotMatch()
        {
            TerminalInput input;


            input = new TerminalInput(new Token("C", "V"));

            Assert.IsFalse(input.Match(new Token("C", "v")));
            Assert.IsFalse(input.Match(new TerminalInput(new Token("C", "v"))));
            Assert.IsFalse(input.Match(new NonTerminalInput("a")));
            Assert.IsFalse(input.Match(new EOSInput <Token>()));
        }
Beispiel #4
0
        public void ShouldNotMatch()
        {
            TerminalInput input;


            input = new TerminalInput('a');

            Assert.IsFalse(input.Match('b'));
            Assert.IsFalse(input.Match(new TerminalInput('b')));
            Assert.IsFalse(input.Match(new NonTerminalInput("a")));
            Assert.IsFalse(input.Match(new EOSInput <char>()));
        }