You've already forked linux-packaging-mono
Imported Upstream version 6.0.0.241
Former-commit-id: 6bb91ae3d8008b2e06beaf4212ad32102b270e2a
This commit is contained in:
parent
2bc8cfd5d0
commit
1efc83b696
@ -776,5 +776,23 @@ namespace MonoTests.System.Globalization
|
||||
|
||||
Assert.IsTrue (f ().Wait (5 * 1000), "#1");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SpanToUpperInvariantDoesntUseCurrentCulture ()
|
||||
{
|
||||
string testStr = "test";
|
||||
var dst = new Span<char> (new char [testStr.Length]);
|
||||
CultureInfo savedCulture = CultureInfo.CurrentCulture;
|
||||
CultureInfo.CurrentCulture = new InterceptingLocale ();
|
||||
testStr.AsSpan ().ToUpperInvariant (dst); // should not throw InvalidOperationException ("Shouldn't be called.")
|
||||
CultureInfo.CurrentCulture = savedCulture;
|
||||
Assert.AreEqual ("TEST", dst.ToString ());
|
||||
}
|
||||
|
||||
private class InterceptingLocale : CultureInfo
|
||||
{
|
||||
public InterceptingLocale () : base (string.Empty) { }
|
||||
public override TextInfo TextInfo => throw new InvalidOperationException ("Shouldn't be called.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user