From 4ab6c1107905210e10ea4286521bac7fb4d14550 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 11 Apr 2022 23:57:15 +0900 Subject: [PATCH] Add failing test coverage of skin import after exporting from lazer --- osu.Game.Tests/Skins/IO/ImportSkinTest.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/osu.Game.Tests/Skins/IO/ImportSkinTest.cs b/osu.Game.Tests/Skins/IO/ImportSkinTest.cs index 9b0facd625..dde8715764 100644 --- a/osu.Game.Tests/Skins/IO/ImportSkinTest.cs +++ b/osu.Game.Tests/Skins/IO/ImportSkinTest.cs @@ -11,6 +11,7 @@ using osu.Framework.Allocation; using osu.Framework.Extensions; using osu.Framework.Platform; using osu.Game.Database; +using osu.Game.Extensions; using osu.Game.IO; using osu.Game.IO.Archives; using osu.Game.Skinning; @@ -110,6 +111,27 @@ namespace osu.Game.Tests.Skins.IO assertImportedOnce(import1, import2); }); + [Test] + public Task TestImportExportedSkinFilename() => runSkinTest(async osu => + { + MemoryStream exportStream = new MemoryStream(); + + var import1 = await loadSkinIntoOsu(osu, new ZipArchiveReader(createOskWithIni("name 1", "author 1"), "custom.osk")); + assertCorrectMetadata(import1, "name 1 [custom]", "author 1", osu); + + import1.PerformRead(s => + { + new LegacySkinExporter(osu.Dependencies.Get()).ExportModelTo(s, exportStream); + }); + + string exportFilename = import1.GetDisplayString(); + + var import2 = await loadSkinIntoOsu(osu, new ZipArchiveReader(exportStream, $"{exportFilename}.osk")); + assertCorrectMetadata(import2, "name 1 [custom]", "author 1", osu); + + assertImportedOnce(import1, import2); + }); + [Test] public Task TestSameMetadataNameSameFolderName() => runSkinTest(async osu => {