fix(settings): an imported ini moved to the trains' tapes too, a closed tape window forgets only its own tape

- ImportFrom moves an ini of before the trains' tapes as a profile is
- HaslerTapes.Forget takes the file: a window closing lets go of its own tape, not of the one
  another window follows
This commit is contained in:
maj00r
2026-11-16 00:09:36 +01:00
parent 13990a7036
commit 76693c1494
5 changed files with 50 additions and 5 deletions

View File

@@ -1436,6 +1436,24 @@ public class SettingsStoreTests
Assert.False(installation.SettingsStore.Settings.PhysicsLogTrains);
}
[Fact]
public void An_imported_ini_from_before_the_tapes_of_the_trains_is_moved_as_a_profile_is()
{
string backup = Path.Combine("/home/kolejarz", "backup", "eu07.ini");
var files = new InMemoryFileSystem()
.WithFile(UserIni, "physicslog yes\nphysicslog.trains no\n")
.WithFile(backup, "physicslog yes\nblackbox yes\n");
var store = WithHome(files).SettingsStore;
store.Load();
Assert.True(store.ImportFrom(backup));
store.Save();
Assert.False(store.Settings.PhysicsLog);
Assert.True(store.Settings.PhysicsLogTrains);
Assert.Contains("physicslog.trains yes", files.ReadAllText(UserIni, System.Text.Encoding.UTF8));
}
[Fact]
public void Once_moved_the_physics_log_of_every_vehicle_turned_on_again_stays_on()
{