コード例 #1
0
        public void TestAnyCharInMatcher()
        {
            var m = Matcher.AnyCharIn('a', 'b');

            Assert.Equal(1, m.Match(new MatchContent("abc", 0, MatchDirection.Forward)));
            Assert.Equal(Matcher.NotMatch, m.Match(new MatchContent("abc", 0, MatchDirection.Backward)));
            Assert.Equal(1, m.Match(new MatchContent("abc", 1, MatchDirection.Forward)));
            Assert.Equal(1, m.Match(new MatchContent("abc", 1, MatchDirection.Backward)));
            Assert.Equal(Matcher.NotMatch, m.Match(new MatchContent("abc", 2, MatchDirection.Forward)));
            Assert.Equal(1, m.Match(new MatchContent("abc", 2, MatchDirection.Backward)));
            Assert.Equal(Matcher.NotMatch, m.Match(new MatchContent("abc", 3, MatchDirection.Forward)));
            Assert.Equal(Matcher.NotMatch, m.Match(new MatchContent("abc", 3, MatchDirection.Backward)));
        }