public void CaseInsensitive_IgnoresCase()
        {
            var matcher = new InclusionMatcher(ignoreCase: true);

            matcher.AddIncludeRule(@"xx");

            var result = matcher.Match("XX");

            Assert.IsTrue(result);
        }
        public void CaseSensitive_MatchesCase()
        {
            var matcher = new InclusionMatcher(ignoreCase: false);

            matcher.AddIncludeRule(@"xx");

            var result = matcher.Match("XX");

            Assert.IsFalse(result);
        }
        public void AddIncludeRuleFirst_ExcludesByDefault()
        {
            var matcher = new InclusionMatcher();

            matcher.AddIncludeRule(@"xx");

            var result = matcher.Match("blah");

            Assert.IsFalse(result);
        }
Exemplo n.º 4
0
        public void ExcludeBranches()
        {
            m_branchMatcher.AddExcludeRule(@"^branch2");
            m_branchMatcher.AddIncludeRule(@"^branch1");

            var parser = CreateParser(CvsLogParserResources.Branches);

            parser.Parse().ToList();
            var file = parser.Files.Single();

            Assert.AreEqual(file.GetBranchpointForBranch("branch1"), Revision.Create("1.1"));
            Assert.AreEqual(file.GetBranchpointForBranch("branch2"), Revision.Empty);
            Assert.AreEqual(parser.ExcludedBranches.Single(), "branch2");
        }
        public void AddIncludeThenExclude_Matches()
        {
            var matcher = new InclusionMatcher();

            matcher.AddIncludeRule(@"xx");
            matcher.AddExcludeRule(@"yy");

            var result = matcher.Match("aaxx");

            Assert.IsTrue(result);

            result = matcher.Match("xxyy");
            Assert.IsFalse(result);
        }