コード例 #1
0
        public void CaseInsensitive_IgnoresCase()
        {
            var matcher = new InclusionMatcher(ignoreCase: true);

            matcher.AddIncludeRule(@"xx");

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

            Assert.IsTrue(result);
        }
コード例 #2
0
        public void CaseSensitive_MatchesCase()
        {
            var matcher = new InclusionMatcher(ignoreCase: false);

            matcher.AddIncludeRule(@"xx");

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

            Assert.IsFalse(result);
        }
コード例 #3
0
        public void AddIncludeRuleFirst_ExcludesByDefault()
        {
            var matcher = new InclusionMatcher();

            matcher.AddIncludeRule(@"xx");

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

            Assert.IsFalse(result);
        }
コード例 #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");
        }
コード例 #5
0
        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);
        }