You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by la...@apache.org on 2015/05/24 20:49:07 UTC

lucenenet git commit: always show fuzzy query output

Repository: lucenenet
Updated Branches:
  refs/heads/failingtests 025436344 -> d81788e2b


always show fuzzy query output


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/d81788e2
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/d81788e2
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/d81788e2

Branch: refs/heads/failingtests
Commit: d81788e2becc50ed74fb01d3748ebf6369cfd6dc
Parents: 0254363
Author: Laimonas Simutis <la...@gmail.com>
Authored: Sun May 24 14:48:54 2015 -0400
Committer: Laimonas Simutis <la...@gmail.com>
Committed: Sun May 24 14:48:54 2015 -0400

----------------------------------------------------------------------
 .../core/Search/TestFuzzyQuery.cs                 | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d81788e2/src/Lucene.Net.Tests/core/Search/TestFuzzyQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestFuzzyQuery.cs b/src/Lucene.Net.Tests/core/Search/TestFuzzyQuery.cs
index 8f3b217..f61cedd 100644
--- a/src/Lucene.Net.Tests/core/Search/TestFuzzyQuery.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestFuzzyQuery.cs
@@ -271,17 +271,23 @@ namespace Lucene.Net.Search
             IndexSearcher searcher = NewSearcher(mr);
             FuzzyQuery fq = new FuzzyQuery(new Term("field", "z123456"), 1, 0, 2, false);
             TopDocs docs = searcher.Search(fq, 2);
+            Exception ex = null;
             try
             {
-
                 Assert.AreEqual(5, docs.TotalHits); // 5 docs, from the a and b's
             }
-            catch (AssertionException)
+            catch (AssertionException e)
+            {
+                ex = e;
+            }
+
+            Console.WriteLine("Collected output:");
+            Console.WriteLine(collector);
+            OutputCollector.Init(null);
+            
+            if (ex != null)
             {
-                Console.WriteLine("Collected output:");
-                Console.WriteLine(collector);
-                OutputCollector.Init(null);
-                throw;
+                throw ex;
             }
 
             mr.Dispose();