public void AddExcludeRuleFirst_IncludesByDefault()
        {
            var matcher = new InclusionMatcher();

            matcher.AddExcludeRule(@"xx");

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

            Assert.IsTrue(result);
        }
예제 #2
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);
        }