-
Notifications
You must be signed in to change notification settings - Fork 820
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RavenDB-22311 Alphanumerical sorter - index out of range exception fix
- Loading branch information
1 parent
c93bcf7
commit f0ec2a8
Showing
2 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Linq; | ||
using FastTests; | ||
using Raven.Client.Documents; | ||
using Raven.Client.Documents.Session; | ||
using Tests.Infrastructure; | ||
using Tests.Infrastructure.Entities; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace SlowTests.Issues; | ||
|
||
public class RavenDB_22311 : RavenTestBase | ||
{ | ||
public RavenDB_22311(ITestOutputHelper output) : base(output) | ||
{ | ||
} | ||
|
||
[RavenFact(RavenTestCategory.Lucene | RavenTestCategory.Querying)] | ||
public void AlphanumericalWillShiftWithGoodOffsetSize() | ||
{ | ||
using var store = GetDocumentStore(Options.ForSearchEngine(RavenSearchEngineMode.Lucene)); | ||
using var session = store.OpenSession(); | ||
session.Store(new Order(){Company = "🚀1t"}); | ||
session.Store(new Order(){Company = "🚀1"}); | ||
session.SaveChanges(); | ||
|
||
var result = session.Query<Order>() | ||
.Customize(c => c.WaitForNonStaleResults()) | ||
.OrderBy(x => x.Company, OrderingType.AlphaNumeric) | ||
.ToList(); | ||
|
||
Assert.Equal("🚀1", result[0].Company); | ||
Assert.Equal("🚀1t", result[1].Company); | ||
} | ||
} |