lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lai...@apache.org
Subject lucenenet git commit: additional test
Date Sat, 23 May 2015 14:16:53 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/failingtests 81f9d3d6f -> b4406c746


additional test


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

Branch: refs/heads/failingtests
Commit: b4406c746d5564c34c9a13d47cbc7774b7b76b98
Parents: 81f9d3d
Author: Laimonas Simutis <laimis@gmail.com>
Authored: Sat May 23 10:16:28 2015 -0400
Committer: Laimonas Simutis <laimis@gmail.com>
Committed: Sat May 23 10:16:28 2015 -0400

----------------------------------------------------------------------
 .../core/Search/TestTopDocsMerge.cs             | 34 ++++++++++++++++++++
 1 file changed, 34 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b4406c74/src/Lucene.Net.Tests/core/Search/TestTopDocsMerge.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestTopDocsMerge.cs b/src/Lucene.Net.Tests/core/Search/TestTopDocsMerge.cs
index b6e786b..451b7ad 100644
--- a/src/Lucene.Net.Tests/core/Search/TestTopDocsMerge.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestTopDocsMerge.cs
@@ -71,6 +71,40 @@ namespace Lucene.Net.Search
 
         [Test]
         [Category("Focus")]
+        public void QueueTest()
+        {
+            var hitQueue = new HitQueue(10, false);
+
+            var builder = new StringBuilder();
+            OutputCollector.Init(builder);
+            
+            hitQueue.Add(new ScoreDoc(6, 1));
+            hitQueue.Add(new ScoreDoc(5, 1));
+            hitQueue.Add(new ScoreDoc(4, 1));
+            hitQueue.Add(new ScoreDoc(3, 1));
+            hitQueue.Add(new ScoreDoc(2, 1));
+            hitQueue.Add(new ScoreDoc(1, 1));
+            hitQueue.Add(new ScoreDoc(1232, 1));
+            hitQueue.Add(new ScoreDoc(12, 1));
+
+            var results = new ScoreDoc[hitQueue.Size()];
+
+            for (int i = hitQueue.Size() - 1; i >= 0; i--)
+            {
+                results[i] = hitQueue.Pop();
+            }
+
+            OutputCollector.Init(null);
+            
+            foreach (var r in results)
+            {
+                Console.WriteLine(r);
+            }
+            //Console.WriteLine(builder);
+        }
+
+        [Test]
+        [Category("Focus")]
         public virtual void TestSort_1()
         {
             TestSort(false);


Mime
View raw message