Free fork of NotProton: Windows Steam games in Mac Steam, on CodeWeavers' Wine and Apple's Game Porting Toolkit
Swift apple-silicond3dmetaldxmtdxvkgame-porting-toolkitgptkmac-gamingmacosmetalfxrosetta-2steamsteam-playwinewinecx
fix(migration): carry notproton.none over and import BridgeplayApp in tests
raymondchins12cfc6a5fe3e
diff --git a/app/Sources/BridgeplayApp/Model/BrandMigration.swift b/app/Sources/BridgeplayApp/Model/BrandMigration.swiftindex 57d89d3..d9e4b6c 100644--- a/app/Sources/BridgeplayApp/Model/BrandMigration.swift+++ b/app/Sources/BridgeplayApp/Model/BrandMigration.swift@@ -457,10 +457,11 @@ struct BrandMigration: Sendable {// Steam maps Cloud save paths only for tool names containing "proton".static let newToolPrefix = "bridgeplay-proton"- // notproton -> bridgeplay-proton, notproton-<x> -> bridgeplay-proton-<x>; nil when the- // tool is not ours.+ // notproton -> bridgeplay-proton, notproton-<x> -> bridgeplay-proton-<x>, and the+ // panel's "no tool" choice notproton.none -> bridgeplay-proton.none; nil when the tool+ // is not ours.static func migratedToolName(_ name: String) -> String? {- guard name == "notproton" || name.hasPrefix("notproton-") else { return nil }+ guard name == "notproton" || name.hasPrefix("notproton-") || name.hasPrefix("notproton.") else { return nil }return newToolPrefix + name.dropFirst("notproton".count)}diff --git a/app/Tests/BridgeplayAppTests/BrandMigrationTests.swift b/app/Tests/BridgeplayAppTests/BrandMigrationTests.swiftindex 5866bd6..af8c73b 100644--- a/app/Tests/BridgeplayAppTests/BrandMigrationTests.swift+++ b/app/Tests/BridgeplayAppTests/BrandMigrationTests.swift@@ -1,7 +1,7 @@import Foundationimport Testing-@testable import NotProtonApp+@testable import BridgeplayApp@Suite("Moving a NotProton install to Bridgeplay 3.0.0")struct BrandMigrationTests {@@ -454,6 +454,8 @@ struct BrandMigrationTests {@Test("Tool names: only ours are renamed")func toolNames() {#expect(BrandMigration.migratedToolName("notproton") == "bridgeplay-proton")+ #expect(BrandMigration.migratedToolName("notproton.none") == "bridgeplay-proton.none")+ #expect(BrandMigration.migratedToolName("notprotonish") == nil)#expect(BrandMigration.migratedToolName("notproton-winecx-11.17") == "bridgeplay-proton-winecx-11.17")#expect(BrandMigration.migratedToolName("notproton-fex-winecx-11.17") == "bridgeplay-proton-fex-winecx-11.17")#expect(BrandMigration.migratedToolName("notprotonx") == nil)diff --git a/app/Tests/BridgeplayAppTests/PrefixToolsTests.swift b/app/Tests/BridgeplayAppTests/PrefixToolsTests.swiftindex 62c8a63..0549dcc 100644--- a/app/Tests/BridgeplayAppTests/PrefixToolsTests.swift+++ b/app/Tests/BridgeplayAppTests/PrefixToolsTests.swift@@ -30,13 +30,13 @@ struct PrefixToolsTests {@Test("Log paths match where compat_run.sh writes them")func logPathsMatchRunScript() throws {let source = try Self.compatSource()- // compat_run.sh is renamed separately from the app; either spelling is a match until- // both land, and the app falls back to the old file names anyway.+ // The app falls back to the pre-3.0 file names, so either spelling of a log is a match.func either(_ text: (String) -> String) -> Bool {source.contains(text("bridgeplay")) || source.contains(text("notproton"))}#expect(either { #"log="$STEAM_COMPAT_DATA_PATH/\#($0)-run.log""# })- #expect(either { #"loader_root="$HOME/Library/Application Support/\#($0)/launchers/$app_id""# })+ #expect(source.contains(#"loader_root="$np_support/launchers/$app_id""#))+ #expect(source.contains(#"np_support="$HOME/Library/Application Support/bridgeplay""#))#expect(either { #"wine_log="$loader_root/\#($0)-wine.log""# })let prefix = samplePrefix()