mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-04 05:11:50 +01:00
List a key taken out of eu07.ini once
A uart or uarttune the settings no longer write was found missing twice, as a key of set length and as one the file had, and showed twice among the changes.
This commit is contained in:
@@ -319,6 +319,18 @@ public class SettingsStoreTests
|
|||||||
Assert.DoesNotContain(lines, l => l.StartsWith("uart "));
|
Assert.DoesNotContain(lines, l => l.StartsWith("uart "));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void A_disabled_uart_is_one_change()
|
||||||
|
{
|
||||||
|
var installation = WithHome(new InMemoryFileSystem().WithFile(UserIni, "uart COM3 57600 0.1\n"));
|
||||||
|
installation.SettingsStore.Load();
|
||||||
|
installation.SettingsStore.Settings.UartEnabled = false;
|
||||||
|
|
||||||
|
var changes = installation.SettingsStore.Changes(installation.SettingsStore.Settings);
|
||||||
|
|
||||||
|
Assert.Equal(new IniChange("uart", "COM3 57600 0.1", null), Assert.Single(changes, c => c.Key == "uart"));
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void The_graphics_card_choice_survives_a_round_trip()
|
public void The_graphics_card_choice_survives_a_round_trip()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -289,6 +289,7 @@ public sealed class SettingsStore
|
|||||||
var now = Render(settings);
|
var now = Render(settings);
|
||||||
var shown = _capture?.ShownUnlikeSettings ?? new Dictionary<string, ShownValue>();
|
var shown = _capture?.ShownUnlikeSettings ?? new Dictionary<string, ShownValue>();
|
||||||
var changes = new List<IniChange>();
|
var changes = new List<IniChange>();
|
||||||
|
var listed = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
|
||||||
foreach (string key in SettingsSerializer.ObsoleteKeys)
|
foreach (string key in SettingsSerializer.ObsoleteKeys)
|
||||||
Add(key, null);
|
Add(key, null);
|
||||||
@@ -325,7 +326,8 @@ public sealed class SettingsStore
|
|||||||
{
|
{
|
||||||
// To the simulator a key past endconfig is not set yet, whatever it says.
|
// To the simulator a key past endconfig is not set yet, whatever it says.
|
||||||
string? before = value is not null && _config.IsPastEnd(key) ? null : _config.GetRaw(key);
|
string? before = value is not null && _config.IsPastEnd(key) ? null : _config.GetRaw(key);
|
||||||
if (before != value)
|
// A key gone from the file can be found gone more ways than one.
|
||||||
|
if (before != value && listed.Add(key))
|
||||||
changes.Add(new IniChange(key, before, value));
|
changes.Add(new IniChange(key, before, value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user