Skip to content

Conversation

ajaybhargavb
Copy link
Contributor

@ajaybhargavb ajaybhargavb commented Jan 16, 2019

Fixes https://github.com/aspnet/AspNetCore-Internal/issues/1601

It looks like OrderBy() is using a different default StringComparer between Windows and Linux which is why we were seeing failures only on Ubuntu CI. I've now specified the StringComparer and changed the ordering to match what is expected.

@ajaybhargavb
Copy link
Contributor Author

Minimal repro,

static void Main(string[] args)
{
    var arr = new[] { "A", "B", "_" };
    Console.WriteLine(string.Join(", ", arr.OrderBy(a => a)));
}

outputs,
_, A, B on Windows
A, B, _ on Linux

@stephentoub, is there a reason for this inconsistency?

@stephentoub
Copy link
Member

String comparison is by default culturally aware, and there's a difference in the culture data on Windows (coming from the OS) vs on Linux (coming from ICU).

@ajaybhargavb ajaybhargavb merged commit ad31f94 into release/2.1 Jan 16, 2019
@ajaybhargavb ajaybhargavb deleted the ajbaaska/fix-tests branch January 16, 2019 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants