lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [2/6] lucenenet git commit: fix string format to match what Lucene is doing
Date Sat, 07 Mar 2015 17:29:19 GMT
fix string format to match what Lucene is doing


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

Branch: refs/heads/master
Commit: aea4304e743bdb4c3569f2e97795c3fec1b2f6ec
Parents: dd7dba7
Author: Laimonas Simutis <laimis@gmail.com>
Authored: Sat Mar 7 07:20:36 2015 -0500
Committer: Laimonas Simutis <laimis@gmail.com>
Committed: Sat Mar 7 07:20:36 2015 -0500

----------------------------------------------------------------------
 src/Lucene.Net.Tests/core/Search/TestRegexpRandom.cs   | 7 +------
 src/Lucene.Net.Tests/core/Search/TestWildcardRandom.cs | 6 +-----
 2 files changed, 2 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/aea4304e/src/Lucene.Net.Tests/core/Search/TestRegexpRandom.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestRegexpRandom.cs b/src/Lucene.Net.Tests/core/Search/TestRegexpRandom.cs
index 218cf69..947e70a 100644
--- a/src/Lucene.Net.Tests/core/Search/TestRegexpRandom.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestRegexpRandom.cs
@@ -1,4 +1,3 @@
-using System.Globalization;
 using System.Text;
 using Lucene.Net.Documents;
 
@@ -60,13 +59,9 @@ namespace Lucene.Net.Search
             Field field = NewField("field", "", customType);
             doc.Add(field);
 
-            NumberFormatInfo df = new NumberFormatInfo();
-            df.NumberDecimalDigits = 0;
-
-            //NumberFormat df = new DecimalFormat("000", new DecimalFormatSymbols(Locale.ROOT));
             for (int i = 0; i < 1000; i++)
             {
-                field.StringValue = i.ToString(df);
+                field.StringValue = i.ToString("D3");
                 writer.AddDocument(doc);
             }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/aea4304e/src/Lucene.Net.Tests/core/Search/TestWildcardRandom.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestWildcardRandom.cs b/src/Lucene.Net.Tests/core/Search/TestWildcardRandom.cs
index 4b3e376..6edad77 100644
--- a/src/Lucene.Net.Tests/core/Search/TestWildcardRandom.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestWildcardRandom.cs
@@ -58,13 +58,9 @@ namespace Lucene.Net.Search
             Field field = NewStringField("field", "", Field.Store.NO);
             doc.Add(field);
 
-            NumberFormatInfo df = new NumberFormatInfo();
-            df.NumberDecimalDigits = 0;
-
-            //NumberFormat df = new DecimalFormat("000", new DecimalFormatSymbols(Locale.ROOT));
             for (int i = 0; i < 1000; i++)
             {
-                field.StringValue = i.ToString(df);
+                field.StringValue = i.ToString("D3");
                 writer.AddDocument(doc);
             }
 


Mime
View raw message