diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2012-04-30 15:20:46 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2012-04-30 15:20:46 +0400 |
commit | a54f71e02e29e5cff3adc8af6c4f2ff7d4454d32 (patch) | |
tree | af2b0b81d0753d2421bbe7e2835949576b7f7ac1 | |
parent | c85127be834bbe9dc6f8bbb8e491953b0a60961c (diff) |
[UnitTests] Fixed ignored unit tests.
-rw-r--r-- | main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/BacktrackingStringMatcher.cs | 17 | ||||
-rw-r--r-- | main/tests/UnitTests/MonoDevelop.Ide.Gui/CompletionListWindowTests.cs | 18 |
2 files changed, 26 insertions, 9 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/BacktrackingStringMatcher.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/BacktrackingStringMatcher.cs index 4432390b14..d6b435f233 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/BacktrackingStringMatcher.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/BacktrackingStringMatcher.cs @@ -126,12 +126,23 @@ namespace MonoDevelop.Core.Text // word start is either a upper case letter (FooBar) or a char that follows a non letter // like foo:bar if ((char.IsUpper (text [j]) || filterCharIsDigit) && filterChar == text [j] || - (filterChar == char.ToUpper (text [j]) && j > 0 && text [j - 1] != '#' && !char.IsLetterOrDigit (text [j - 1]))) - return j; + (filterChar == char.ToUpper (text [j]) && j > 0 && !char.IsLetterOrDigit (text [j - 1]))) { + if (HasLetter (text, j)) + return j; + } } return -1; } - + + static bool HasLetter (string text, int i) + { + for (int j = 0; j < i; j++) { + var ch = text [j]; + if (ch == '_' || char.IsLetterOrDigit (ch)) + return true; + } + return false; + } /// <summary> /// Gets the match indices. /// </summary> diff --git a/main/tests/UnitTests/MonoDevelop.Ide.Gui/CompletionListWindowTests.cs b/main/tests/UnitTests/MonoDevelop.Ide.Gui/CompletionListWindowTests.cs index d31071cfbe..ed5521ee9b 100644 --- a/main/tests/UnitTests/MonoDevelop.Ide.Gui/CompletionListWindowTests.cs +++ b/main/tests/UnitTests/MonoDevelop.Ide.Gui/CompletionListWindowTests.cs @@ -457,17 +457,24 @@ namespace MonoDevelop.Ide.Gui "Addd", }; - [Ignore] [Test] public void TestMatchPunctuation () { string output = RunSimulation ("", "/\n", true, false, false, punctuationData); Assert.AreEqual ("/AbAb", output); - - output = RunSimulation ("", "A\n", true, false, false, punctuationData); + } + + [Test] + public void TestMatchPunctuationCase2 () + { + string output = RunSimulation ("", "A\n", true, false, false, punctuationData); Assert.AreEqual ("AbAb", output); - - output = RunSimulation ("", ",A..\n", true, false, false, punctuationData); + } + + [Test] + public void TestMatchPunctuationCase3 () + { + string output = RunSimulation ("", ",A..\n", true, false, false, punctuationData); Assert.AreEqual (",A..bAb", output); } @@ -492,7 +499,6 @@ namespace MonoDevelop.Ide.Gui Assert.AreEqual (null, output); } - [Ignore] [Test] public void TestMatchPunctuationCommitOnSpaceAndPunctuation4 () { |