Beispiel #1
0
        private void generateMatchList_0()
        {
            string path     = "src/document/DocumentCommandHandler.js";
            var    specials = FuzzyMatch.FindSpecialCharacters(path);
            var    result   = FuzzyMatch.GenerateMatchList("foo", path, specials.specials, specials.lastSegmentSpecialsIndex);

            Assert.Equal(null, result);
        }
Beispiel #2
0
        private void generateMatchList_1()
        {
            string path     = "src/document/DocumentCommandHandler.js";
            var    specials = FuzzyMatch.FindSpecialCharacters(path);

            path = path.ToLower();
            var result = FuzzyMatch.GenerateMatchList("d", path, specials.specials, specials.lastSegmentSpecialsIndex);

            Assert.Equal(13, result[0].index);
        }
Beispiel #3
0
        void CheckFSC(string test, List <int> specials, int lastSegmentSpecialIndex)
        {
            var res = FuzzyMatch.FindSpecialCharacters(test);

            Assert.Equal(specials.Count, res.specials.Count);

            int i;

            for (i = 0; i < specials.Count; i++)
            {
                Assert.Equal(specials[i], res.specials[i]);
            }

            Assert.Equal(lastSegmentSpecialIndex, res.lastSegmentSpecialsIndex);
        }