Expand test to cover both legacy and non-legacy export paths

This commit is contained in:
Bartłomiej Dach 2024-04-30 16:07:37 +02:00
parent 6a7e2dc258
commit 38e239a435
No known key found for this signature in database
1 changed files with 24 additions and 1 deletions

View File

@ -24,7 +24,7 @@ public partial class TestSceneBeatmapSkinResources : OsuTestScene
private BeatmapManager beatmaps { get; set; } = null!;
[Test]
public void TestRetrieveJapaneseFilename()
public void TestRetrieveAndLegacyExportJapaneseFilename()
{
IWorkingBeatmap beatmap = null!;
MemoryStream outStream = null!;
@ -46,6 +46,29 @@ public void TestRetrieveJapaneseFilename()
AddAssert("sample is non-null", () => beatmap.Skin.GetSample(new SampleInfo(@"見本")) != null);
}
[Test]
public void TestRetrieveAndNonLegacyExportJapaneseFilename()
{
IWorkingBeatmap beatmap = null!;
MemoryStream outStream = null!;
// Ensure importer encoding is correct
AddStep("import beatmap", () => beatmap = importBeatmapFromArchives(@"japanese-filename.osz"));
AddAssert("sample is non-null", () => beatmap.Skin.GetSample(new SampleInfo(@"見本")) != null);
// Ensure exporter encoding is correct (round trip)
AddStep("export", () =>
{
outStream = new MemoryStream();
new BeatmapExporter(LocalStorage)
.ExportToStream((BeatmapSetInfo)beatmap.BeatmapInfo.BeatmapSet!, outStream, null);
});
AddStep("import beatmap again", () => beatmap = importBeatmapFromStream(outStream));
AddAssert("sample is non-null", () => beatmap.Skin.GetSample(new SampleInfo(@"見本")) != null);
}
[Test]
public void TestRetrieveOggAudio()
{