From f2dba9719745b591c03c793a203d2a13a26edfad Mon Sep 17 00:00:00 2001 From: adelikat Date: Thu, 6 Aug 2020 13:15:25 -0500 Subject: [PATCH] Tasproj versioning - use constant in unit test so it doesn't fail on next version bump, when converting bk2, slap the current tasproj verison on it, converting to bk2, remove tasproj version --- .../movie/MovieConversionExtensions.cs | 6 ++++++ src/BizHawk.Tests/Client.Common/Movie/MovieServiceTests.cs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/BizHawk.Client.Common/movie/MovieConversionExtensions.cs b/src/BizHawk.Client.Common/movie/MovieConversionExtensions.cs index a950ba3d6d..855178307b 100644 --- a/src/BizHawk.Client.Common/movie/MovieConversionExtensions.cs +++ b/src/BizHawk.Client.Common/movie/MovieConversionExtensions.cs @@ -30,6 +30,9 @@ namespace BizHawk.Client.Common tas.HeaderEntries[kvp.Key] = kvp.Value; } + // TODO: we have this version number string generated in multiple places + tas.HeaderEntries[HeaderKeys.MovieVersion] = $"BizHawk v2.0 Tasproj v{TasMovie.CurrentVersion}"; + tas.SyncSettingsJson = old.SyncSettingsJson; tas.Comments.Clear(); @@ -63,6 +66,9 @@ namespace BizHawk.Client.Common bk2.HeaderEntries[kvp.Key] = kvp.Value; } + // TODO: we have this version number string generated in multiple places + bk2.HeaderEntries[HeaderKeys.MovieVersion] = "BizHawk v2.0"; + bk2.SyncSettingsJson = old.SyncSettingsJson; bk2.Comments.Clear(); diff --git a/src/BizHawk.Tests/Client.Common/Movie/MovieServiceTests.cs b/src/BizHawk.Tests/Client.Common/Movie/MovieServiceTests.cs index d16498f29b..ace5d5ab01 100644 --- a/src/BizHawk.Tests/Client.Common/Movie/MovieServiceTests.cs +++ b/src/BizHawk.Tests/Client.Common/Movie/MovieServiceTests.cs @@ -13,7 +13,7 @@ namespace BizHawk.Common.Tests.Client.Common.Movie [DataRow("NonsenseString", 1.0)] [DataRow("BizHawk v2.0", 1.0)] [DataRow("BizHawk v2.0 Tasproj v1.0", 1.0)] - [DataRow("BizHawk v2.0 Tasproj v1.1", 1.1)] + [DataRow("BizHawk v2.0 Tasproj v1.1", TasMovie.CurrentVersion)] public void ParseTasMovieVersion(string movieVersion, double expected) { var actual = MovieService.ParseTasMovieVersion(movieVersion);