diff options
| author | Bond-009 <bond.009@outlook.com> | 2024-09-07 18:09:52 -0400 |
|---|---|---|
| committer | Joshua M. Boniface <joshua@boniface.me> | 2024-09-07 18:09:52 -0400 |
| commit | 7631956451af5927c1c9850eb4e106dc4d0cdde1 (patch) | |
| tree | c80d3cc48f88f3ed60e5c43de6955e02ee9aeeee /tests/Jellyfin.Extensions.Tests/FormattingStreamWriterTests.cs | |
| parent | c7bb2fe137aea5b819a86eb50bd51f094135c546 (diff) | |
Backport pull request #12550 from jellyfin/release-10.9.z
Create and use FormattingStreamWriter
Original-merge: cd2f2ca17800f71c8d94a6e043b49b7c4200e254
Merged-by: Bond-009 <bond.009@outlook.com>
Backported-by: Joshua M. Boniface <joshua@boniface.me>
Diffstat (limited to 'tests/Jellyfin.Extensions.Tests/FormattingStreamWriterTests.cs')
| -rw-r--r-- | tests/Jellyfin.Extensions.Tests/FormattingStreamWriterTests.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/Jellyfin.Extensions.Tests/FormattingStreamWriterTests.cs b/tests/Jellyfin.Extensions.Tests/FormattingStreamWriterTests.cs new file mode 100644 index 0000000000..06e3c27213 --- /dev/null +++ b/tests/Jellyfin.Extensions.Tests/FormattingStreamWriterTests.cs @@ -0,0 +1,23 @@ +using System.Globalization; +using System.IO; +using System.Text; +using System.Threading; +using Xunit; + +namespace Jellyfin.Extensions.Tests; + +public static class FormattingStreamWriterTests +{ + [Fact] + public static void Shuffle_Valid_Correct() + { + Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE", false); + using (var ms = new MemoryStream()) + using (var txt = new FormattingStreamWriter(ms, CultureInfo.InvariantCulture)) + { + txt.Write("{0}", 3.14159); + txt.Close(); + Assert.Equal("3.14159", Encoding.UTF8.GetString(ms.ToArray())); + } + } +} |
