[hyena] tests: Replace SortKey tests on empty strings with a single space



commit adb0a553a589164998d7519a02c958e31fb95f45
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Fri Nov 1 15:37:31 2013 +0100

    tests: Replace SortKey tests on empty strings with a single space
    
    It seems the value returned by CompareInfo.GetSortKey for an empty
    string has changed in recent mono versions: it used to be a byte[5], now
    it's just a empty byte array. This matches what is returned by .NET on
    Windows, so I guess that change was a compatibility fix.
    
    This made 2 of our unit tests fail, so we now do those tests with a
    single space instead of an empty string, which is probably more
    significant anyway.

 .../Hyena.Data.Sqlite/Tests/SqliteUtilTests.cs     |    2 +-
 Hyena/Hyena/Tests/StringUtilTests.cs               |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/Hyena.Data.Sqlite/Hyena.Data.Sqlite/Tests/SqliteUtilTests.cs 
b/Hyena.Data.Sqlite/Hyena.Data.Sqlite/Tests/SqliteUtilTests.cs
index 2ccc8be..a363f4a 100644
--- a/Hyena.Data.Sqlite/Hyena.Data.Sqlite/Tests/SqliteUtilTests.cs
+++ b/Hyena.Data.Sqlite/Hyena.Data.Sqlite/Tests/SqliteUtilTests.cs
@@ -51,7 +51,7 @@ namespace Hyena.Data.Sqlite.Tests
         {
             // See Hyena.StringUtil.Tests for full tests. This just checks that
             // the collation function is actually being used.
-            CollationKeyTest ("", new byte[] {1, 1, 1, 1, 0});
+            CollationKeyTest (" ", new byte[] {7, 2, 1, 1, 1, 1, 0});
             CollationKeyTest ("\u0104", new byte[] {14, 2, 1, 27, 1, 1, 1, 0});
         }
     }
diff --git a/Hyena/Hyena/Tests/StringUtilTests.cs b/Hyena/Hyena/Tests/StringUtilTests.cs
index 66a27b7..756dc60 100644
--- a/Hyena/Hyena/Tests/StringUtilTests.cs
+++ b/Hyena/Hyena/Tests/StringUtilTests.cs
@@ -341,9 +341,9 @@ href=http://lkjdflkjdflkjj>baz foo< /a> bar"));
         }
 
         [Test]
-        public void TestEmpty ()
+        public void TestSpace ()
         {
-            AssertSortKey ("", new byte[] {1, 1, 1, 1, 0});
+            AssertSortKey (" ", new byte[] {7, 2, 1, 1, 1, 1, 0});
         }
 
         [Test]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]