lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [2/2] lucenenet git commit: fix number formatting
Date Sun, 08 Mar 2015 00:13:36 GMT
fix number formatting


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

Branch: refs/heads/master
Commit: 52b13ba03ec69b4a5b4a937ade79fbb92b5f6f5a
Parents: 0a1964e
Author: Laimonas Simutis <laimis@gmail.com>
Authored: Sat Mar 7 17:33:35 2015 -0500
Committer: Laimonas Simutis <laimis@gmail.com>
Committed: Sat Mar 7 17:33:35 2015 -0500

----------------------------------------------------------------------
 .../core/Search/TestMultiValuedNumericRangeQuery.cs       | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/52b13ba0/src/Lucene.Net.Tests/core/Search/TestMultiValuedNumericRangeQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestMultiValuedNumericRangeQuery.cs b/src/Lucene.Net.Tests/core/Search/TestMultiValuedNumericRangeQuery.cs
index 0cd5dcc..c473302 100644
--- a/src/Lucene.Net.Tests/core/Search/TestMultiValuedNumericRangeQuery.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestMultiValuedNumericRangeQuery.cs
@@ -46,11 +46,7 @@ namespace Lucene.Net.Search
         {
             Directory directory = NewDirectory();
             RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, NewIndexWriterConfig(TEST_VERSION_CURRENT,
new MockAnalyzer(Random())).SetMaxBufferedDocs(TestUtil.NextInt(Random(), 50, 1000)));
-
-            //DecimalFormat format = new DecimalFormat("00000000000", new DecimalFormatSymbols(Locale.ROOT));
-            NumberFormatInfo f = new NumberFormatInfo();
-            f.NumberDecimalSeparator = ".";
-            f.NumberDecimalDigits = 0;
+            const string format = "D11";
 
             int num = AtLeast(500);
             for (int l = 0; l < num; l++)
@@ -59,7 +55,7 @@ namespace Lucene.Net.Search
                 for (int m = 0, c = Random().Next(10); m <= c; m++)
                 {
                     int value = Random().Next(int.MaxValue);
-                    doc.Add(NewStringField("asc", value.ToString(f), Field.Store.NO));
+                    doc.Add(NewStringField("asc", value.ToString(format), Field.Store.NO));
                     doc.Add(new IntField("trie", value, Field.Store.NO));
                 }
                 writer.AddDocument(doc);
@@ -79,7 +75,7 @@ namespace Lucene.Net.Search
                     lower = upper;
                     upper = a;
                 }
-                TermRangeQuery cq = TermRangeQuery.NewStringRange("asc", lower.ToString(f),
upper.ToString(f), true, true);
+                TermRangeQuery cq = TermRangeQuery.NewStringRange("asc", lower.ToString(format),
upper.ToString(format), true, true);
                 NumericRangeQuery<int> tq = NumericRangeQuery.NewIntRange("trie", lower,
upper, true, true);
                 TopDocs trTopDocs = searcher.Search(cq, 1);
                 TopDocs nrTopDocs = searcher.Search(tq, 1);


Mime
View raw message