Exemple #1
0
        public void MatchBegin()
        {
            const string str     = "psaiodusaiu saiud saiduais";
            const string pattern = "psa";

            Assert.AreEqual(0, StringAlgorithms.PatternMatch(str, pattern));
        }
Exemple #2
0
        public void PatternIsBigger()
        {
            const string str     = "psaiodusaiu saiud saiduais";
            const string pattern = "ppsaiodusaiu saiud saiduaisa";

            Assert.AreEqual(-1, StringAlgorithms.PatternMatch(str, pattern));
        }
Exemple #3
0
        public void DoesNotMatch()
        {
            const string str     = "psaiodusaiu saiud saiduais";
            const string pattern = "xy";

            Assert.AreEqual(-1, StringAlgorithms.PatternMatch(str, pattern));
        }
Exemple #4
0
        public void AlmostMatchAtEnd()
        {
            const string str     = "psaiodusaiu saiud saiduais";
            const string pattern = "isx";

            Assert.AreEqual(-1, StringAlgorithms.PatternMatch(str, pattern));
        }
Exemple #5
0
        public void Equals()
        {
            const string str     = "a";
            const string pattern = "a";

            Assert.AreEqual(0, StringAlgorithms.PatternMatch(str, pattern));
        }