1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:17:51 +08:00

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

View File

@ -24,7 +24,7 @@ namespace osu.Game.Tests.Skins
private BeatmapManager beatmaps { get; set; } = null!; private BeatmapManager beatmaps { get; set; } = null!;
[Test] [Test]
public void TestRetrieveJapaneseFilename() public void TestRetrieveAndLegacyExportJapaneseFilename()
{ {
IWorkingBeatmap beatmap = null!; IWorkingBeatmap beatmap = null!;
MemoryStream outStream = null!; MemoryStream outStream = null!;
@ -46,6 +46,29 @@ namespace osu.Game.Tests.Skins
AddAssert("sample is non-null", () => beatmap.Skin.GetSample(new SampleInfo(@"見本")) != null); 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] [Test]
public void TestRetrieveOggAudio() public void TestRetrieveOggAudio()
{ {