Skip to content

A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.

Fix main: EditMode pins expected Ghazawiya to have no Hebrew name (after #1344) (#1376)

Eyal Golan080bbff2fb9e
diff --git a/changelog.d/main-editmode-1344.md b/changelog.d/main-editmode-1344.md
new file mode 100644
index 000000000..90d68901f
--- /dev/null
+++ b/changelog.d/main-editmode-1344.md
@@ -0,0 +1,2 @@
+- Tests: three Unity EditMode tests pinned Ghazawiya as the locality without a Hebrew name; since #1344 it has one
+ (אל-גזאוויה), so they check that name and keep the English fallback covered with a row whose name_he is cleared.
diff --git a/unity/Assets/Tests/EditMode/HebrewUiTests.cs b/unity/Assets/Tests/EditMode/HebrewUiTests.cs
index 9cbbfefc7..876c390cd 100644
--- a/unity/Assets/Tests/EditMode/HebrewUiTests.cs
+++ b/unity/Assets/Tests/EditMode/HebrewUiTests.cs
@@ -375,8 +375,9 @@ public class HebrewUiTests
}
}
- /// <summary>#880: in Hebrew every map name pill shows its row's name_he, and its English name where the row has none (a
- /// 1948 locality such as Ghazawiya); an English restart puts the English names back. #1008: a GDD v0.2 map location
+ /// <summary>#880: in Hebrew every map name pill shows its row's name_he, and its English name where the row has none; an
+ /// English restart puts the English names back. Since #1344 every 1948 locality has a name_he (Ghazawiya's is
+ /// אל-גזאוויה), so the fallback is checked by clearing one row's name_he and starting again. #1008: a GDD v0.2 map location
/// (content/map/locations_1948.yaml) is named in both languages too, and the one with a settlement's id (jerusalem)
/// names that settlement's pill: "מערב ירושלים", "West Jerusalem".</summary>
[Test]
@@ -394,7 +395,7 @@ public class HebrewUiTests
Assert.AreEqual("נשר", Ui.Q<Label>("label-nesher").text, "a 1948 locality with a name_he");
Assert.AreEqual("נענה", Ui.Q<Label>("label-naana").text, "#1219: Na'ana has a sourced name_he now");
Assert.AreEqual("סאלחיה", Ui.Q<Label>("label-al_salihiyya").text, "#1313: Salihiya has a sourced name_he now");
- Assert.AreEqual("Ghazawiya", Ui.Q<Label>("label-al_ghazzawiyya").text, "no name_he: the English name stays");
+ Assert.AreEqual("אל-גזאוויה", Ui.Q<Label>("label-al_ghazzawiyya").text, "#1344: Ghazawiya has a sourced name_he now");
var locations = Inputs.Content.MapLocations.ToDictionary(l => l.Id);
Assert.AreEqual("מערב ירושלים", Ui.Q<Label>("label-jerusalem").text, "#1008: Jerusalem's pill is West Jerusalem's");
foreach (var s in map.Settlements)
@@ -402,6 +403,10 @@ public class HebrewUiTests
foreach (var l in locations.Values) Assert.AreEqual(l.NameHe, Ui.Q<Label>("label-" + l.Id).text, l.Id);
foreach (var p in map.Localities)
Assert.AreEqual(string.IsNullOrWhiteSpace(p.NameHe) ? p.Settlement.Name : p.NameHe, Ui.Q<Label>("label-" + p.Settlement.Id).text, p.Settlement.Id);
+ // No row lacks a name_he now: clear Ghazawiya's on this build's copy, and the pill falls back to the English name.
+ map.Localities.Single(p => p.Settlement.Id == "al_ghazzawiyya").NameHe = null;
+ game.Begin(Inputs, 0);
+ Assert.AreEqual("Ghazawiya", Ui.Q<Label>("label-al_ghazzawiyya").text, "no name_he: the English name stays");
game.Language = UiLanguage.English;
game.Begin(Inputs, 0);
diff --git a/unity/Assets/Tests/EditMode/KitTests.cs b/unity/Assets/Tests/EditMode/KitTests.cs
index 270e8ad80..6c18dac0d 100644
--- a/unity/Assets/Tests/EditMode/KitTests.cs
+++ b/unity/Assets/Tests/EditMode/KitTests.cs
@@ -542,7 +542,7 @@ public class KitTests
Assert.AreEqual("ביסאן", tsv.Places.Single(p => p.Settlement.Id == "beit_shean").NameHe, "#558: the 1948 form, as the English shows it");
Assert.AreEqual("נענה", tsv.Places.Single(p => p.Settlement.Id == "naana").NameHe, "#1219: the he.wiki-sourced name");
Assert.AreEqual("סאלחיה", tsv.Places.Single(p => p.Settlement.Id == "al_salihiyya").NameHe, "#1313: the sourced name");
- Assert.IsNull(tsv.Places.Single(p => p.Settlement.Id == "al_ghazzawiyya").NameHe, "#558: no sourced Hebrew name, so none");
+ Assert.AreEqual("אל-גזאוויה", tsv.Places.Single(p => p.Settlement.Id == "al_ghazzawiyya").NameHe, "#1344: the he.wiki-sourced name");
}
/// <summary>A malformed runtime row is an error naming the file and the line.</summary>
@@ -552,7 +552,9 @@ public class KitTests
var b = (34.2, 35.9, 29.45, 33.35);
var reserved = new[] { "tel_aviv" };
const string ok = "place\ta\tA\t\t\t\t35.0\t32.0\tvillage\tmosque\t0\t1200\tdraft\t2026-10-11\t3";
- Assert.AreEqual(1, Localities.ParseRuntime("# header\n" + ok + "\n", b, reserved, "loc.tsv").Places.Count);
+ var okPlaces = Localities.ParseRuntime("# header\n" + ok + "\n", b, reserved, "loc.tsv").Places;
+ Assert.AreEqual(1, okPlaces.Count);
+ Assert.IsNull(okPlaces[0].NameHe, "an empty name_he column reads as none (#558; no real row is empty since #1344)");
void Bad(string tsv, string expect)
{
var ex = Assert.Throws<System.IO.InvalidDataException>(() => Localities.ParseRuntime(tsv, b, reserved, "loc.tsv"));
diff --git a/unity/Assets/Tests/EditMode/LocalityNameTests.cs b/unity/Assets/Tests/EditMode/LocalityNameTests.cs
index 80d5d41df..1f98d8b35 100644
--- a/unity/Assets/Tests/EditMode/LocalityNameTests.cs
+++ b/unity/Assets/Tests/EditMode/LocalityNameTests.cs
@@ -108,19 +108,21 @@ public class LocalityNameTests
}
/// <summary>#899: under Hebrew each 1948 locality is named by its name_he (Beisan is ביסאן), and by the English name where the
- /// row has none (Ghazawiya). Where the Hebrew 1948 name and the Hebrew today name are one word (Umm el Fahm and Umm al-Fahm
- /// are both אום אל-פחם: 48 rows that would otherwise show a today name), the "today" part would repeat the name, so it is left out. English is unchanged.</summary>
+ /// row has none (since #1344 every row has one, so a copy of Ghazawiya's row without it stands in). Where the Hebrew
+ /// 1948 name and the Hebrew today name are one word (Umm el Fahm and Umm al-Fahm are both אום אל-פחם: 48 rows that would otherwise show a today name), the "today" part would repeat the name, so it is left out. English is unchanged.</summary>
[Test]
public void TheHebrewPanelNamesEach1948LocalityByItsHebrewName()
{
var by = map.Localities.ToDictionary(p => p.Settlement.Id);
var (beisan, salihiyya, ghazawiya, naana, fahm) = (by["beit_shean"], by["al_salihiyya"], by["al_ghazzawiyya"], by["naana"], by["umm_al_fahm"]);
- Assert.IsNull(ghazawiya.NameHe, "Ghazawiya has no Hebrew name");
+ Assert.AreEqual("אל-גזאוויה", ghazawiya.NameHe, "#1344: the he.wiki-sourced name");
+ var unnamed = new Localities.Place { Settlement = ghazawiya.Settlement, Today = ghazawiya.Today, TodayHe = ghazawiya.TodayHe };
Assert.AreEqual("סאלחיה", salihiyya.NameHe, "#1313: the sourced name");
Assert.AreEqual("נענה", naana.NameHe, "#1219: the he.wiki-sourced name");
Assert.AreEqual(fahm.NameHe, fahm.TodayHe, "one Hebrew word for 1948 and today");
Assert.AreEqual("יישובים ב-1948: ביסאן (היום: בית שאן)", InfoPanelPresenter.LocalitiesText(He, new[] { beisan }));
- Assert.AreEqual(He.Format("info.localities", "Ghazawiya"), InfoPanelPresenter.LocalitiesText(He, new[] { ghazawiya })); // Format marks the Latin run
+ Assert.AreEqual("יישובים ב-1948: אל-גזאוויה", InfoPanelPresenter.LocalitiesText(He, new[] { ghazawiya }));
+ Assert.AreEqual(He.Format("info.localities", "Ghazawiya"), InfoPanelPresenter.LocalitiesText(He, new[] { unnamed })); // Format marks the Latin run
Assert.AreEqual("יישובים ב-1948: סאלחיה", InfoPanelPresenter.LocalitiesText(He, new[] { salihiyya }));
Assert.AreEqual("יישובים ב-1948: נענה", InfoPanelPresenter.LocalitiesText(He, new[] { naana }));
Assert.AreEqual("יישובים ב-1948: אום אל-פחם", InfoPanelPresenter.LocalitiesText(He, new[] { fahm }));