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.

UI: the IL money prefix carries a no-break space, so a value never wraps (Refs #2293) (#2296)

agamrafaeli-instinct50833c2ceff1
diff --git a/changelog.d/2293-money-nbsp.md b/changelog.d/2293-money-nbsp.md
new file mode 100644
index 000000000..6c02fe57f
--- /dev/null
+++ b/changelog.d/2293-money-nbsp.md
@@ -0,0 +1,3 @@
+### Fixed
+- Money values no longer wrap between the currency and the amount in either language: the IL prefix carries a
+ no-break space (Refs #2293).
diff --git a/content/model.yaml b/content/model.yaml
index 7cb2bf090..dac303dca 100644
--- a/content/model.yaml
+++ b/content/model.yaml
@@ -37,12 +37,13 @@ situations:
# can read them through their indicator conditions (Q-NAT-3, decided 15 October 2026, #375; R-NAT-002, R-NAT-004).
- { id: low_cohesion, indicator: morale, on_below: 0.30, off_above: 0.45, name: Low social cohesion } # DESIGN VALUE: owner-set balance, not a historical figure (D-C1, Q-NAT-3)
- { id: low_intl_support, indicator: intl_standing, on_below: 0.30, off_above: 0.45, name: Low international support } # DESIGN VALUE: owner-set balance, not a historical figure (D-C1, Q-NAT-3)
-# Money the sim tracks (these three ids, in millions): the name and the currency prefix the player sees.
+# Money the sim tracks (these three ids, in millions): the name and the currency prefix the player sees. The IL prefixes end in a no-break space
+# (U+00A0), so a money value never wraps between the currency and the amount (#2293).
# The treasury is the GDD's Money (R-MONEY-001; spec §1.2 "Treasury becomes Money", owner, 15 October 2026, Q-MONEY-4).
# Debt and foreign currency stay internal, under Money (D-C3, Q-MONEY-1).
money:
- - { id: treasury, name: Money, prefix: 'IL ' }
- - { id: debt, name: Debt, prefix: 'IL ' }
+ - { id: treasury, name: Money, prefix: 'IL ' }
+ - { id: debt, name: Debt, prefix: 'IL ' }
- { id: fx_reserves, name: Foreign currency, prefix: '$' }
voter_groups:
- { id: veterans, weights: { morale: 0.6, security: 0.4 } }
diff --git a/sim/Statecraft.Sim.Tests/CauseKeysTests.cs b/sim/Statecraft.Sim.Tests/CauseKeysTests.cs
index f2d5d4936..cdc07184e 100644
--- a/sim/Statecraft.Sim.Tests/CauseKeysTests.cs
+++ b/sim/Statecraft.Sim.Tests/CauseKeysTests.cs
@@ -150,7 +150,7 @@ public class CauseKeysTests
var s = new GameState { Treasury = 0, Debt = 0 }; var why = new List<Cause>();
EconomySystem.PayNamedOrBorrow(Fix, s, 3, "for civilian upkeep", why, CauseKeys.Purpose.CivilianUpkeep); // as PayCivilianUpkeep
var line = Assert.Single(why);
- Assert.Equal((CauseKeys.Borrowed, "Borrowed IL 3.0m for civilian upkeep"), (line.Key, line.Message));
+ Assert.Equal((CauseKeys.Borrowed, "Borrowed IL\u00A03.0m for civilian upkeep"), (line.Key, line.Message));
Assert.Equal(new[] { CauseKeys.Purpose.CivilianUpkeep }, line.Args);
// #2199: PayOrBorrow names the whole cost as a Money line first, with the same purpose, then the borrowing.
diff --git a/sim/Statecraft.Sim.Tests/CityProjectsTests.cs b/sim/Statecraft.Sim.Tests/CityProjectsTests.cs
index dc743f732..7f18d74b2 100644
--- a/sim/Statecraft.Sim.Tests/CityProjectsTests.cs
+++ b/sim/Statecraft.Sim.Tests/CityProjectsTests.cs
@@ -30,7 +30,7 @@ public class CityProjectsTests
var p = one.State.CityProjects.Values.Single();
Assert.Equal(("housing", "town_a", 1, 1, 1, (DateTime?)null), (p.Kind, p.City, p.Q, p.R, p.TurnsLeft, p.BuiltOn)); // 2 turns, this one the first
Assert.Equal(Step(c, s).State.Treasury - 3, one.State.Treasury, 9); // paid in full at the start (Q-PROJ-1)
- Assert.Contains(one.Why, x => x.System == "city" && x.Message == "Town A: a housing project began, cost IL 3.0m");
+ Assert.Contains(one.Why, x => x.System == "city" && x.Message == "Town A: a housing project began, cost IL\u00A03.0m");
Assert.Equal(s.Cities["town_a"].HousingCapacity, one.State.Cities["town_a"].HousingCapacity); // nothing yet
var two = Step(c, one.State);
@@ -144,7 +144,7 @@ public class CityProjectsTests
s.Treasury = 1;
var r = Step(c, s, Housing());
Assert.Empty(r.Rejected);
- Assert.Contains(r.Why, x => x.System == "economy" && x.Message == "Borrowed IL 2.0m to build a housing project");
+ Assert.Contains(r.Why, x => x.System == "economy" && x.Message == "Borrowed IL\u00A02.0m to build a housing project");
}
// R-PROJ-001 (Q-HOUSE-3, D-D3): the transit camp keeps the ma'abarot policy gate, which carries its sourced date; with the
diff --git a/sim/Statecraft.Sim.Tests/CorridorsTests.cs b/sim/Statecraft.Sim.Tests/CorridorsTests.cs
index e0d8c9246..a0efe40a4 100644
--- a/sim/Statecraft.Sim.Tests/CorridorsTests.cs
+++ b/sim/Statecraft.Sim.Tests/CorridorsTests.cs
@@ -39,7 +39,7 @@ public class CorridorsTests
Assert.Null(r.State.Corridors["road_a"].Segments[0]);
Assert.True(Projects.IsBusy(r.State, id[0]));
Assert.Equal(Step(c, s).State.Treasury - 1.5, r.State.Treasury, 9);
- Assert.Contains(r.Why, x => x.System == "map" && x.Message == "Road A, segment 2: a group of halutzim began building, cost IL 1.5m");
+ Assert.Contains(r.Why, x => x.System == "map" && x.Message == "Road A, segment 2: a group of halutzim began building, cost IL\u00A01.5m");
var rail = Step(c, s, new PioneerWork(id[0], Corridors.BuildRail, "rail_a:1"));
Assert.Empty(rail.Rejected);
Assert.Equal(Step(c, s).State.Treasury - 3, rail.State.Treasury, 9); // the rail kind's cost
@@ -222,7 +222,7 @@ public class CorridorsTests
var why = new List<Cause>();
Assert.Null(Projects.Start(c, s, id[0], Corridors.BuildRoad, "road_a:1", why));
Assert.Equal((0.0, 4.0), (s.Treasury, s.Debt));
- Assert.Contains(why, x => x.System == "economy" && x.Target == "debt" && x.Message == "Borrowed IL 1.0m to build a corridor segment");
+ Assert.Contains(why, x => x.System == "economy" && x.Target == "debt" && x.Message == "Borrowed IL\u00A01.0m to build a corridor segment");
}
// R-COR-002: corridors advance after sites, in ordinal corridor id, then segment index.
diff --git a/sim/Statecraft.Sim.Tests/DollarsTests.cs b/sim/Statecraft.Sim.Tests/DollarsTests.cs
index 05aa008c7..8b188b7d3 100644
--- a/sim/Statecraft.Sim.Tests/DollarsTests.cs
+++ b/sim/Statecraft.Sim.Tests/DollarsTests.cs
@@ -72,7 +72,7 @@ public class DollarsTests
s.Treasury = 0;
var none = Simulation.Step(c, s, Array.Empty<Command>()).State;
var sold = Simulation.Step(c, s, new Command[] { new ConvertDollars(amount) }).State;
- Assert.True(none.Debt > 0 && none.Debt < 0.5, $"the fixture's turn borrows under IL 0.5m ({none.Debt})");
+ Assert.True(none.Debt > 0 && none.Debt < 0.5, $"the fixture's turn borrows under IL\u00A00.5m ({none.Debt})");
Assert.Equal((0.0, 0.0), (none.Treasury, sold.Debt));
Assert.Equal(none.Treasury - none.Debt + amount * 0.5, sold.Treasury - sold.Debt, 9);
Assert.Equal(none.FxReserves - amount, sold.FxReserves, 9);
diff --git a/sim/Statecraft.Sim.Tests/EconomyCalibrationTests.cs b/sim/Statecraft.Sim.Tests/EconomyCalibrationTests.cs
index 219a05e31..1fbc9eeee 100644
--- a/sim/Statecraft.Sim.Tests/EconomyCalibrationTests.cs
+++ b/sim/Statecraft.Sim.Tests/EconomyCalibrationTests.cs
@@ -75,7 +75,7 @@ public class EconomyCalibrationTests
{
var perYear = C.Rules.TaxPerCapitaPerYear * On(new DateTime(1950, 10, 1), s => s.TotalPopulation);
Assert.True(Math.Abs(perYear - 60) / 60 <= DebtTolerance,
- $"[consistency: tax_per_capita_per_year is derived from this anchor] tax revenue {F(perYear)}m a year; budget IL 60m");
+ $"[consistency: tax_per_capita_per_year is derived from this anchor] tax revenue {F(perYear)}m a year; budget IL\u00A060m");
}
[Fact]
diff --git a/sim/Statecraft.Sim.Tests/FieldsTests.cs b/sim/Statecraft.Sim.Tests/FieldsTests.cs
index 4f5e3835b..b3b924a25 100644
--- a/sim/Statecraft.Sim.Tests/FieldsTests.cs
+++ b/sim/Statecraft.Sim.Tests/FieldsTests.cs
@@ -111,7 +111,7 @@ public class FieldsTests
Assert.Empty(r.Rejected);
Assert.Equal(("site_a_field", (int?)id, 1), (r.State.Sites["site_a_field"].Site, r.State.Sites["site_a_field"].Unit, r.State.Sites["site_a_field"].TurnsLeft));
Assert.Equal(Step(c, s).State.Treasury - 0.5, r.State.Treasury, 9);
- Assert.Contains(r.Why, x => x.System == "map" && x.Message == "Site A fields: a group of halutzim began plowing, cost IL 0.5m");
+ Assert.Contains(r.Why, x => x.System == "map" && x.Message == "Site A fields: a group of halutzim began plowing, cost IL\u00A00.5m");
var done = Step(c, r.State);
Assert.Equal(done.State.Date, done.State.Sites["site_a_field"].BuiltOn); // the end of the order's turn + 1
diff --git a/sim/Statecraft.Sim.Tests/FinalWaveTests.cs b/sim/Statecraft.Sim.Tests/FinalWaveTests.cs
index 8f944210f..aa84d4b82 100644
--- a/sim/Statecraft.Sim.Tests/FinalWaveTests.cs
+++ b/sim/Statecraft.Sim.Tests/FinalWaveTests.cs
@@ -143,7 +143,7 @@ public class FinalWaveTests
Assert.Null(MapActions.Apply(c, s, MapActions.TransitCamp, ok.Q, ok.R, why));
Assert.Equal("This hex already has a transit camp", MapActions.Check(c, s, MapActions.TransitCamp, ok.Q, ok.R));
var built = Assert.Single(why, w => w.System == "map");
- Assert.StartsWith("Built a transit camp: cost IL 1.5m", built.Message);
+ Assert.StartsWith("Built a transit camp: cost IL\u00A01.5m", built.Message, StringComparison.Ordinal);
Assert.DoesNotMatch(@"\(-?\d+, -?\d+\)", built.Message);
}
diff --git a/sim/Statecraft.Sim.Tests/Fixture.cs b/sim/Statecraft.Sim.Tests/Fixture.cs
index 0ee7d9131..4132a4776 100644
--- a/sim/Statecraft.Sim.Tests/Fixture.cs
+++ b/sim/Statecraft.Sim.Tests/Fixture.cs
@@ -127,8 +127,8 @@ situations:
off_above: 0.45
name: Hunger
money:
- - { id: treasury, name: Treasury, prefix: 'IL ' }
- - { id: debt, name: Debt, prefix: 'IL ' }
+ - { id: treasury, name: Treasury, prefix: 'IL ' }
+ - { id: debt, name: Debt, prefix: 'IL ' }
- { id: fx_reserves, name: Foreign currency, prefix: '$' }
voter_groups:
- id: everyone
diff --git a/sim/Statecraft.Sim.Tests/Gdd03MoneyLedgerTests.cs b/sim/Statecraft.Sim.Tests/Gdd03MoneyLedgerTests.cs
index b1d1d6e34..a8100f252 100644
--- a/sim/Statecraft.Sim.Tests/Gdd03MoneyLedgerTests.cs
+++ b/sim/Statecraft.Sim.Tests/Gdd03MoneyLedgerTests.cs
@@ -206,7 +206,7 @@ public class Gdd03MoneyLedgerTests
foreach (var w in a.Why.Where(w => w.Key == CauseKeys.Borrowed)) borrowedFor.Add(w.Args[0]);
poor = a.State; rich = b.State;
}
- Assert.True(poor.Debt > 0 && rich.Debt == 0, $"the empty Treasury borrowed IL {N(poor.Debt)}m, the full one IL {N(rich.Debt)}m");
+ Assert.True(poor.Debt > 0 && rich.Debt == 0, $"the empty Treasury borrowed IL\u00A0{N(poor.Debt)}m, the full one IL\u00A0{N(rich.Debt)}m");
Assert.Subset(borrowedFor, new HashSet<string> { CauseKeys.Purpose.Deficit, CauseKeys.Purpose.Training, CauseKeys.Purpose.Project, CauseKeys.Purpose.Arms });
}
diff --git a/sim/Statecraft.Sim.Tests/MapActionTests.cs b/sim/Statecraft.Sim.Tests/MapActionTests.cs
index 4d06f137f..1a59b41d0 100644
--- a/sim/Statecraft.Sim.Tests/MapActionTests.cs
+++ b/sim/Statecraft.Sim.Tests/MapActionTests.cs
@@ -32,7 +32,7 @@ public class MapActionTests
Assert.Equal(housing + 0.05, s.Indicators["housing"], 9);
Assert.Equal(morale - 0.02, s.Indicators["morale"], 9);
Assert.Equal("transit_camp", MapActions.At(s, 2, 0)!.Action);
- Assert.Contains(why, w => w.System == "map" && w.Message == "Built a transit camp: cost IL 2.0m, Housing +5.0%, Morale -2.0%");
+ Assert.Contains(why, w => w.System == "map" && w.Message == "Built a transit camp: cost IL\u00A02.0m, Housing +5.0%, Morale -2.0%");
}
[Fact]
@@ -44,7 +44,7 @@ public class MapActionTests
Assert.Null(MapActions.Apply(C, s, "housing", 1, 1, why));
Assert.Equal(0, s.Treasury);
Assert.Equal(5, s.Debt, 9);
- Assert.Contains(why, w => w.Message == "Borrowed IL 5.0m to build a housing project");
+ Assert.Contains(why, w => w.Message == "Borrowed IL\u00A05.0m to build a housing project");
}
[Fact]
diff --git a/sim/Statecraft.Sim.Tests/MoneyCausesTests.cs b/sim/Statecraft.Sim.Tests/MoneyCausesTests.cs
index 09f2df083..30881786c 100644
--- a/sim/Statecraft.Sim.Tests/MoneyCausesTests.cs
+++ b/sim/Statecraft.Sim.Tests/MoneyCausesTests.cs
@@ -222,7 +222,7 @@ public class MoneyCausesTests
public void NoOtherLineWhenNothingIsLeftOver(double[] deltas, bool expected)
{
var why = deltas.Select(d => new Cause("economy", "treasury", d, PlayerText.Change(Real, "treasury", d), key: CauseKeys.CivilianUpkeep))
- .Append(new Cause("economy", "debt", 5, "borrowed IL 5.0m to cover the deficit", key: CauseKeys.Borrowed)) // not a Money cause
+ .Append(new Cause("economy", "debt", 5, "borrowed IL\u00A05.0m to cover the deficit", key: CauseKeys.Borrowed)) // not a Money cause
.ToList();
var largest = Largest(why, 2);
var other = EconomySystem.OtherMoney(Real, why, largest);
diff --git a/sim/Statecraft.Sim.Tests/MoneyTests.cs b/sim/Statecraft.Sim.Tests/MoneyTests.cs
index 883af5bca..dc96b91f3 100644
--- a/sim/Statecraft.Sim.Tests/MoneyTests.cs
+++ b/sim/Statecraft.Sim.Tests/MoneyTests.cs
@@ -14,7 +14,7 @@ public class MoneyTests
public void TheTreasuryIsShownAsMoney()
{
Assert.Equal("Money", PlayerText.Target(C, "treasury"));
- Assert.Equal("IL 2.0m", PlayerText.Money(C, "treasury", 2));
+ Assert.Equal("IL\u00A02.0m", PlayerText.Money(C, "treasury", 2));
Assert.Equal(new[] { "treasury", "debt", "fx_reserves" }, C.Money.Select(m => m.Id));
Assert.Equal("Debt", PlayerText.Target(C, "debt"));
Assert.Equal("Foreign currency", PlayerText.Target(C, "fx_reserves"));
diff --git a/sim/Statecraft.Sim.Tests/OptionEffectPreviewTests.cs b/sim/Statecraft.Sim.Tests/OptionEffectPreviewTests.cs
index 44ed2abe8..0c851df9f 100644
--- a/sim/Statecraft.Sim.Tests/OptionEffectPreviewTests.cs
+++ b/sim/Statecraft.Sim.Tests/OptionEffectPreviewTests.cs
@@ -76,7 +76,7 @@ public class OptionEffectPreviewTests
rows.Select(x => (x.Cause.System, x.Cause.Target, x.Cause.Delta, x.Cause.Message)));
Assert.Equal(new[] { "halutz", "treasury", "food", "arms", "halutz", "halutz", "veteran_halutz", "town_a.housing_capacity", "town_a.job_slots", "town_b.condition", "maabarot", "rationing", "rung", "rejoin" },
rows.Select(x => x.Cause.Target));
- Assert.Equal(new[] { "+4.1%", "IL -1.3m", "+3", "-100", "2", "1", "3", "+3", "-100", "+5.1%", "20%", "75%", "4", "" },
+ Assert.Equal(new[] { "+4.1%", "IL\u00A0-1.3m", "+3", "-100", "2", "1", "3", "+3", "-100", "+5.1%", "20%", "75%", "4", "" },
rows.Select(x => x.Amount));
Assert.Equal(new[] { "halutz", "treasury", "food", "arms", "town_a", "town_b", "town_a", "town_a", "town_a", "town_b", "maabarot", "rationing", "", "preview_record" },
rows.Select(x => x.ContextId));
diff --git a/sim/Statecraft.Sim.Tests/PlayerTextTests.cs b/sim/Statecraft.Sim.Tests/PlayerTextTests.cs
index cfec445d9..ac2a89b95 100644
--- a/sim/Statecraft.Sim.Tests/PlayerTextTests.cs
+++ b/sim/Statecraft.Sim.Tests/PlayerTextTests.cs
@@ -237,7 +237,7 @@ public class PlayerTextTests
[InlineData("14 immigrants arrived from asia", "asia")]
[InlineData("Morale +4.1% (homes_lift_morale)", "homes_lift_morale")]
[InlineData("Food supply +5.0% (austerity_1949)", "austerity_1949")]
- [InlineData("transit_camp at (3, 4): cost IL 1.5m", "transit_camp")]
+ [InlineData("transit_camp at (3, 4): cost IL\u00A01.5m", "transit_camp")]
[InlineData("rationing set to 0.50 (Austerity)", "rationing")]
public void TheGuardCatchesOneWordIds(string message, string id) =>
Assert.Contains(Leaks(Real, new[] { message }), l => l.StartsWith($"'{id}'", StringComparison.Ordinal));
@@ -269,7 +269,7 @@ public class PlayerTextTests
[Theory]
[InlineData("chosen: Impose rationing")]
- [InlineData("Built a housing project: cost IL 1.5m, Housing +3.0%, Morale +1.0%")]
+ [InlineData("Built a housing project: cost IL\u00A01.5m, Housing +3.0%, Morale +1.0%")]
[InlineData("Social cohesion -10.9% (Rationing wears on cohesion, Homes lift cohesion, Safety lifts cohesion)")]
[InlineData("reserve call-up raised to 80%, the minimum for security level 5")]
public void TheGuardLeavesPlainEnglishAlone(string message) => Assert.Empty(Leaks(Real, new[] { message }));
@@ -285,14 +285,14 @@ public class PlayerTextTests
foreach (var w in AllCauses(Real))
{
// Every number in the line must carry the unit (fix round 2, N3): strip the unit tokens; no digit may remain.
- if (money.Contains(w.Target) && Regex.IsMatch(Regex.Replace(w.Message, @"(IL |\$)[+-]?\d+\.\dm", ""), @"\d"))
+ if (money.Contains(w.Target) && Regex.IsMatch(Regex.Replace(w.Message, @"(IL\u00A0|\$)[+-]?\d+\.\dm", ""), @"\d"))
bad.Add("money without a unit: " + w.Message);
if (w.System == "map") // "Built a housing project: cost IL 6.0m, Housing +3.0%, ...": every number with its unit
{
// A hex "(q, r)" or "hex q,r", a corridor's "segment N" (R-COR-001, Q-SENS-1) and a unit's "unit N" are names, not
// amounts; movement points and people are units (the enemy's step 1 lines, R-ENEMY-001, reach the reference run).
var named = Regex.Replace(w.Message, @"\(-?\d+, -?\d+\)|segment \d+|hex -?\d+,-?\d+|[Uu]nits? \d+(, \d+)*|\d[\d,]* (movement points|people)", "");
- if (Regex.IsMatch(Regex.Replace(named, @"(IL |\$)[+-]?\d+\.\dm|[+-]?\d+(\.\d)?%", ""), @"\d"))
+ if (Regex.IsMatch(Regex.Replace(named, @"(IL\u00A0|\$)[+-]?\d+\.\dm|[+-]?\d+(\.\d)?%", ""), @"\d"))
bad.Add("map line number without a unit: " + w.Message);
}
else if (indicators.Contains(w.Target) && Regex.IsMatch(Regex.Replace(w.Message, @"[+-]?\d+(\.\d)?%", ""), @"\d"))
@@ -306,19 +306,31 @@ public class PlayerTextTests
[Fact]
public void PlayerTextFormatsMoneyAndTheIndicatorScale()
{
- Assert.Equal("IL 18.6m", PlayerText.Money(Real, "treasury", 18.6));
+ Assert.Equal("IL\u00A018.6m", PlayerText.Money(Real, "treasury", 18.6));
Assert.Equal("$41.5m", PlayerText.Money(Real, "fx_reserves", 41.5));
- Assert.Equal("IL +1.2m", PlayerText.MoneyChange(Real, "treasury", 1.23));
+ Assert.Equal("IL\u00A0+1.2m", PlayerText.MoneyChange(Real, "treasury", 1.23));
Assert.Equal("$-0.4m", PlayerText.MoneyChange(Real, "fx_reserves", -0.4));
Assert.Equal("$0.0m", PlayerText.MoneyChange(Real, "fx_reserves", -0.004));
Assert.Equal(30.0, PlayerText.Scale(0.3), 9);
Assert.Equal("55%", PlayerText.Percent(0.55));
Assert.Equal("+4.1%", PlayerText.PercentChange(0.041));
- Assert.Equal("Money IL -2.0m", PlayerText.Change(Real, "treasury", -2)); // R-MONEY-001
+ Assert.Equal("Money IL\u00A0-2.0m", PlayerText.Change(Real, "treasury", -2)); // R-MONEY-001
Assert.Equal("Social cohesion +5.0%", PlayerText.Change(Real, "morale", 0.05));
Assert.Equal("Foreign currency", PlayerText.Target(Real, "fx_reserves"));
}
+ [Fact]
+ public void MoneyNeverCarriesAPlainSpace()
+ {
+ // #2293: the currency prefix ends in a no-break space, so a money value never wraps between "IL" and the amount.
+ Assert.DoesNotContain(" ", PlayerText.Money(Real, "treasury", 18.6), StringComparison.Ordinal);
+ Assert.DoesNotContain(" ", PlayerText.MoneyChange(Real, "treasury", -1.23), StringComparison.Ordinal);
+ Assert.Equal("IL\u00A0", PlayerText.MoneyParts(Real, "treasury", 18.6).Prefix);
+ Assert.Equal("IL\u00A0", PlayerText.MoneyParts(Real, "debt", 1).Prefix);
+ // City-target lines with a cost skip both branches of EveryCauseNumberCarriesItsUnit: scan every Cause for a hard-coded "IL ".
+ Assert.DoesNotContain(AllCauses(Real), w => w.Message.IndexOf("IL ", StringComparison.Ordinal) >= 0);
+ }
+
/// <summary>Review M3: no silent fallback to the id.</summary>
[Fact]
public void AnUnknownIdIsAnError()
@@ -330,10 +342,10 @@ public class PlayerTextTests
/// <summary>Review M3: the money names and currency prefixes come from content and are validated at load.</summary>
[Theory]
- [InlineData(" - { id: treasury, name: Treasury, prefix: 'IL ' }\n", " - { id: treasury, prefix: 'IL ' }\n", "money[treasury].name")]
+ [InlineData(" - { id: treasury, name: Treasury, prefix: 'IL\u00A0' }\n", " - { id: treasury, prefix: 'IL\u00A0' }\n", "money[treasury].name")]
[InlineData(" - { id: fx_reserves, name: Foreign currency, prefix: '$' }\n", " - { id: fx_reserves, name: Foreign currency }\n", "money[fx_reserves].prefix")]
- [InlineData(" - { id: debt, name: Debt, prefix: 'IL ' }\n", "", "money")]
- [InlineData(" - { id: debt, name: Debt, prefix: 'IL ' }\n", " - { id: debt, name: Debt, prefix: 'IL ' }\n - { id: gold, name: Gold, prefix: 'g' }\n", "money[gold].id")]
+ [InlineData(" - { id: debt, name: Debt, prefix: 'IL\u00A0' }\n", "", "money")]
+ [InlineData(" - { id: debt, name: Debt, prefix: 'IL\u00A0' }\n", " - { id: debt, name: Debt, prefix: 'IL\u00A0' }\n - { id: gold, name: Gold, prefix: 'g' }\n", "money[gold].id")]
public void MoneyNamesAreRequired(string from, string to, string field)
{
var ex = ValidationTests.Bad("model.yaml", from, to);
@@ -384,17 +396,17 @@ public class PlayerTextTests
Assert.Equal("-4.0%", PlayerText.PercentChange(-0.04));
Assert.Equal("+5%", PlayerText.PercentChange(0.05, 0));
Assert.Equal("0%", PlayerText.PercentChange(-0.004, 0));
- Assert.Equal("IL -3.0m", PlayerText.Money(Real, "treasury", -3));
- Assert.Equal("IL 0.0m", PlayerText.Money(Real, "treasury", -0.04));
+ Assert.Equal("IL\u00A0-3.0m", PlayerText.Money(Real, "treasury", -3));
+ Assert.Equal("IL\u00A00.0m", PlayerText.Money(Real, "treasury", -0.04));
// #398 review N2: the parts Money is built from, for the top bar's words ("IL 18.6 million").
- Assert.Equal(("-", "IL ", "3.0"), PlayerText.MoneyParts(Real, "treasury", -3));
- Assert.Equal(("", "IL ", "0.0"), PlayerText.MoneyParts(Real, "treasury", -0.04));
+ Assert.Equal(("-", "IL\u00A0", "3.0"), PlayerText.MoneyParts(Real, "treasury", -3));
+ Assert.Equal(("", "IL\u00A0", "0.0"), PlayerText.MoneyParts(Real, "treasury", -0.04));
Assert.Equal(("", "$", "41.5"), PlayerText.MoneyParts(Real, "fx_reserves", 41.46));
Assert.Equal("$41.5m", PlayerText.Money(Real, "fx_reserves", 41.5));
- Assert.Equal("IL +1.2m", PlayerText.MoneyChange(Real, "treasury", 1.23));
+ Assert.Equal("IL\u00A0+1.2m", PlayerText.MoneyChange(Real, "treasury", 1.23));
Assert.Equal("$-0.4m", PlayerText.MoneyChange(Real, "fx_reserves", -0.4));
Assert.Equal("$0.0m", PlayerText.MoneyChange(Real, "fx_reserves", -0.04));
- Assert.Equal("IL 0.0m", PlayerText.MoneyChange(Real, "treasury", 0.04));
+ Assert.Equal("IL\u00A00.0m", PlayerText.MoneyChange(Real, "treasury", 0.04));
}
[Theory]
@@ -413,9 +425,9 @@ public class PlayerTextTests
// ---- Fix round 2 (N7): money entries that are blank, bare or collide ----
[Theory]
- [InlineData("model.yaml", " - { id: treasury, name: Treasury, prefix: 'IL ' }\n", " - { id: treasury, name: Treasury, prefix: }\n", "money[treasury].prefix")]
- [InlineData("model.yaml", " - { id: treasury, name: Treasury, prefix: 'IL ' }\n", " - { id: treasury, name: Treasury, prefix: ' ' }\n", "money[treasury].prefix")]
- [InlineData("model.yaml", " - { id: debt, name: Debt, prefix: 'IL ' }\n", " - { id: debt, name: Debt, prefix: 'IL ' }\n -\n", "money[2]")]
+ [InlineData("model.yaml", " - { id: treasury, name: Treasury, prefix: 'IL\u00A0' }\n", " - { id: treasury, name: Treasury, prefix: }\n", "money[treasury].prefix")]
+ [InlineData("model.yaml", " - { id: treasury, name: Treasury, prefix: 'IL\u00A0' }\n", " - { id: treasury, name: Treasury, prefix: ' ' }\n", "money[treasury].prefix")]
+ [InlineData("model.yaml", " - { id: debt, name: Debt, prefix: 'IL\u00A0' }\n", " - { id: debt, name: Debt, prefix: 'IL\u00A0' }\n -\n", "money[2]")]
[InlineData("model.yaml", " - id: morale\n", " - id: treasury\n", "indicators[treasury].id")]
[InlineData("model.yaml", " - id: maabarot\n", " - id: debt\n", "policies[debt].id")]
public void MoneyEntriesAreCheckedLikeEveryOtherName(string file, string from, string to, string field)
diff --git a/sim/Statecraft.Sim.Tests/PoolsTests.cs b/sim/Statecraft.Sim.Tests/PoolsTests.cs
index 02baf7dc8..703a69c73 100644
--- a/sim/Statecraft.Sim.Tests/PoolsTests.cs
+++ b/sim/Statecraft.Sim.Tests/PoolsTests.cs
@@ -242,7 +242,7 @@ public class PoolsTests
Assert.Empty(r.Rejected);
Assert.Equal(24, r.State.Arms);
Assert.Equal(Step(c, s).Treasury - 4 * 0.25, r.State.Treasury, 9);
- Assert.Contains(r.Why, x => x.System == "economy" && x.Target == "arms" && x.Delta == 4 && x.Message == "Bought 4 Arms, cost IL 1.0m");
+ Assert.Contains(r.Why, x => x.System == "economy" && x.Target == "arms" && x.Delta == 4 && x.Message == "Bought 4 Arms, cost IL\u00A01.0m");
Assert.Equal(1.0, c.Rules.AttentionCost["buy_arms"]); // before the rung step (R-GOV-002)
}
@@ -258,7 +258,7 @@ public class PoolsTests
Assert.Null(Pools.BuyArms(c, s, 4, why));
Assert.Equal((0.0, 24), (s.Treasury, s.Arms));
Assert.Equal(3.5, s.Debt, 9);
- Assert.Contains(why, x => x.System == "economy" && x.Target == "debt" && x.Message == "Borrowed IL 0.5m for Arms");
+ Assert.Contains(why, x => x.System == "economy" && x.Target == "debt" && x.Message == "Borrowed IL\u00A00.5m for Arms");
}
// R-ARMS-002: fewer than one unit is refused, the state as if the order had not been given (Attention refunded too),
diff --git a/sim/Statecraft.Sim.Tests/ProjectsTests.cs b/sim/Statecraft.Sim.Tests/ProjectsTests.cs
index 410f1e2a5..d7b408e17 100644
--- a/sim/Statecraft.Sim.Tests/ProjectsTests.cs
+++ b/sim/Statecraft.Sim.Tests/ProjectsTests.cs
@@ -39,7 +39,7 @@ public class ProjectsTests
Assert.True(Projects.IsBusy(r.State, id));
Assert.Equal(Step(c, s).State.Treasury - 1.5, r.State.Treasury, 9); // paid in full at the start (question 12)
Assert.Equal((1, 0), (r.State.Units[id].Q, r.State.Units[id].R)); // the unit works from where it stands (question 9)
- Assert.Contains(r.Why, x => x.System == "map" && x.Message == "Site A: a group of halutzim began building a yishuv, cost IL 1.5m");
+ Assert.Contains(r.Why, x => x.System == "map" && x.Message == "Site A: a group of halutzim began building a yishuv, cost IL\u00A01.5m");
}
public static IEnumerable<object[]> Refusals() => new List<object[]>
@@ -99,7 +99,7 @@ public class ProjectsTests
Assert.Equal(0, s.Treasury);
Assert.Equal(3.1, s.Debt, 9);
Assert.Single(s.Sites);
- Assert.Contains(why, x => x.System == "economy" && x.Target == "debt" && x.Message == "Borrowed IL 0.1m to build a yishuv");
+ Assert.Contains(why, x => x.System == "economy" && x.Target == "debt" && x.Message == "Borrowed IL\u00A00.1m to build a yishuv");
var exact = WithHalutz(c, out var other);
exact.Treasury = 1.5;
diff --git a/sim/Statecraft.Sim.Tests/RemainingCauseKeysTests.cs b/sim/Statecraft.Sim.Tests/RemainingCauseKeysTests.cs
index eaaed0084..252f2f0d1 100644
--- a/sim/Statecraft.Sim.Tests/RemainingCauseKeysTests.cs
+++ b/sim/Statecraft.Sim.Tests/RemainingCauseKeysTests.cs
@@ -374,7 +374,7 @@ public class RemainingCauseKeysTests
Assert.Equal("Town A: 4 groups in work", workers.Message);
var training = Assert.Single(result.Why, x => x.Key == "training_started");
Assert.Equal(new[] { "3", "basic", "", "1.5" }, training.Args);
- Assert.Equal("Town A: 3 groups began basic training, cost IL 1.5m", training.Message);
+ Assert.Equal("Town A: 3 groups began basic training, cost IL\u00A01.5m", training.Message);
}
[Theory]
diff --git a/sim/Statecraft.Sim.Tests/ReplacementTests.cs b/sim/Statecraft.Sim.Tests/ReplacementTests.cs
index 5fca19633..2f6643db8 100644
--- a/sim/Statecraft.Sim.Tests/ReplacementTests.cs
+++ b/sim/Statecraft.Sim.Tests/ReplacementTests.cs
@@ -245,7 +245,7 @@ public class ReplacementTests
Assert.Equal(2, r.State.Units[id].Strength); // training_turns 3 counts the turn of the order: two turns to go
var k = Assert.Single(r.State.Cohorts.Values);
Assert.Equal((id, 2), (k.Unit, k.TurnsLeft));
- Assert.Contains(r.Why, x => x.Message == "Tel Aviv: 1 group began basic training as replacements for unit " + id + ", cost IL 0.5m");
+ Assert.Contains(r.Why, x => x.Message == "Tel Aviv: 1 group began basic training as replacements for unit " + id + ", cost IL\u00A00.5m");
}
// R-TRAIN-004 with R-CITY-001: a queued Reinforce takes its city's civilians as a queued Train does.
diff --git a/sim/Statecraft.Sim.Tests/SwampTests.cs b/sim/Statecraft.Sim.Tests/SwampTests.cs
index 470836371..428137a88 100644
--- a/sim/Statecraft.Sim.Tests/SwampTests.cs
+++ b/sim/Statecraft.Sim.Tests/SwampTests.cs
@@ -127,7 +127,7 @@ options:
Assert.Empty(r.Rejected);
Assert.Equal(("marsh", (int?)id, 2), (r.State.Sites["marsh"].Site, r.State.Sites["marsh"].Unit, r.State.Sites["marsh"].TurnsLeft));
Assert.Equal(Step(c, s).State.Treasury - 2, r.State.Treasury, 9);
- Assert.Contains(r.Why, x => x.System == "map" && x.Message == "Marsh: a group of halutzim began draining the swamp, cost IL 2.0m");
+ Assert.Contains(r.Why, x => x.System == "map" && x.Message == "Marsh: a group of halutzim began draining the swamp, cost IL\u00A02.0m");
var mid = Step(c, r.State);
Assert.Null(mid.State.Sites["marsh"].BuiltOn);
diff --git a/sim/Statecraft.Sim.Tests/TrainingTests.cs b/sim/Statecraft.Sim.Tests/TrainingTests.cs
index 70c388504..fbe3bbdb0 100644
--- a/sim/Statecraft.Sim.Tests/TrainingTests.cs
+++ b/sim/Statecraft.Sim.Tests/TrainingTests.cs
@@ -44,7 +44,7 @@ public class TrainingTests
Assert.Equal((id, "recruit", "town_a", 3, 1), (k.Id, k.Type, k.City, k.Count, k.TurnsLeft)); // 2 turns, one of them this one
Assert.Equal(id + 1, r.State.NextId);
Assert.Equal(Step(c, s).State.Treasury - 1.5, r.State.Treasury, 9);
- Assert.Contains(r.Why, x => x.System == "city" && x.Message == "Town A: 3 groups began basic training, cost IL 1.5m");
+ Assert.Contains(r.Why, x => x.System == "city" && x.Message == "Town A: 3 groups began basic training, cost IL\u00A01.5m");
}
// R-TRAIN-001
@@ -127,7 +127,7 @@ public class TrainingTests
Assert.Equal(0, after.Treasury);
Assert.Equal(3.1, after.Debt, 9); // the IL 0.1m the Treasury lacked
Assert.Single(after.Cohorts);
- var borrowed = Assert.Single(why, x => x.System == "economy" && x.Target == "debt" && x.Message == "Borrowed IL 0.1m for training");
+ var borrowed = Assert.Single(why, x => x.System == "economy" && x.Target == "debt" && x.Message == "Borrowed IL\u00A00.1m for training");
Assert.Equal((CauseKeys.Borrowed, CauseKeys.Purpose.Training), (borrowed.Key, Assert.Single(borrowed.Args))); // B1: worded in Hebrew too
var none = s.Clone();
none.Treasury = 0;
diff --git a/sim/Statecraft.Sim.Tests/TreasuryFloorTests.cs b/sim/Statecraft.Sim.Tests/TreasuryFloorTests.cs
index d006b0c76..7f5899190 100644
--- a/sim/Statecraft.Sim.Tests/TreasuryFloorTests.cs
+++ b/sim/Statecraft.Sim.Tests/TreasuryFloorTests.cs
@@ -41,7 +41,7 @@ public class TreasuryFloorTests
Assert.Null(EventSystem.Choose(Real, s, "reparations_claim", "claim", why));
Assert.Equal(0, s.Treasury);
Assert.Equal(3.6, s.Debt, 9);
- Assert.Contains(why, x => x.System == "economy" && x.Target == "debt" && x.Message == "Borrowed IL 0.6m for A Claim on Germany");
+ Assert.Contains(why, x => x.System == "economy" && x.Target == "debt" && x.Message == "Borrowed IL\u00A00.6m for A Claim on Germany");
}
// R-MONEY-003: the Why list reads the event's cost first, then what was borrowed for it.
@@ -55,7 +55,7 @@ public class TreasuryFloorTests
var why = new List<Cause>();
Assert.Null(EventSystem.Choose(Real, s, "reparations_claim", "claim", why));
var money = why.Where(x => x.Target == "treasury" || x.Target == "debt").Select(x => x.Message).ToList();
- Assert.Equal(new[] { "Money IL -1.0m (A Claim on Germany)", "Borrowed IL 0.6m for A Claim on Germany" }, money);
+ Assert.Equal(new[] { "Money IL\u00A0-1.0m (A Claim on Germany)", "Borrowed IL\u00A00.6m for A Claim on Germany" }, money);
}
// R-MONEY-003: an event that brings money in adds it to the Treasury and borrows nothing, debt or no debt.
diff --git a/unity/Assets/Tests/EditMode/BudgetScreenTests.cs b/unity/Assets/Tests/EditMode/BudgetScreenTests.cs
index 470c2327f..f020c5253 100644
--- a/unity/Assets/Tests/EditMode/BudgetScreenTests.cs
+++ b/unity/Assets/Tests/EditMode/BudgetScreenTests.cs
@@ -68,7 +68,7 @@ public class BudgetScreenTests
Assert.AreEqual("spending effect 150%", ui.Q<Label>("budget-defense_minister-factor").text); // capped at 1.5 (playtest 2, P2-6)
var (seats, size) = PoliticsSystem.CoalitionSeats(C, bridge.State.Date); // the council approves the budget (#3)
Assert.AreEqual(System.FormattableString.Invariant($"The Provisional State Council must approve it: the coalition holds {seats} of {size} seats"), ui.Q<Label>("budget-vote").text);
- Assert.AreEqual("Money IL 20.0m · debt IL 0.0m · foreign currency $40.0m", ui.Q<Label>("budget-money").text);
+ Assert.AreEqual("Money IL\u00A020.0m · debt IL\u00A00.0m · foreign currency $40.0m", ui.Q<Label>("budget-money").text);
UiTestKit.Press(ui.Q<Button>("budget-education_minister-up"));
Assert.AreEqual("11%", ui.Q<Label>("budget-education_minister-share").text);
Assert.AreEqual("Changed: submit to put it to the vote", ui.Q<Label>("budget-status").text);
@@ -101,7 +101,7 @@ public class BudgetScreenTests
foreach (var office in C.Rules.BudgetStart.Keys)
Assert.AreEqual("spending effect " + PlayerText.Percent(EffectsSystem.BudgetFactor(budget.Draft, office)), ui.Q<Label>($"budget-{office}-factor").text, office);
var f = EconomySystem.Flows(C, bridge.State, 1.0);
- Assert.AreEqual(System.FormattableString.Invariant($"Taxes IL {f.Tax:0.0}m, spending IL {f.Spending:0.0}m and reserve call-up IL {f.Mobilization:0.0}m a year"), ui.Q<Label>("budget-flow").text);
+ Assert.AreEqual(System.FormattableString.Invariant($"Taxes IL\u00A0{f.Tax:0.0}m, spending IL\u00A0{f.Spending:0.0}m and reserve call-up IL\u00A0{f.Mobilization:0.0}m a year"), ui.Q<Label>("budget-flow").text);
UiTestKit.Press(ui.Q<Button>("budget-education_minister-up"));
Assert.AreEqual("spending effect " + PlayerText.Percent(EffectsSystem.BudgetFactor(budget.Draft, "education_minister")), ui.Q<Label>("budget-education_minister-factor").text);
}
diff --git a/unity/Assets/Tests/EditMode/CauseTextTests.cs b/unity/Assets/Tests/EditMode/CauseTextTests.cs
index fe2765433..6a9646614 100644
--- a/unity/Assets/Tests/EditMode/CauseTextTests.cs
+++ b/unity/Assets/Tests/EditMode/CauseTextTests.cs
@@ -78,7 +78,7 @@ public class CauseTextTests
[Test]
public void MissingHebrewPlaceNamesKeepTheMarkedEnglishFallback()
{
- var row = new Cause("city", "hadera", 0, "Hadera: jobs paid IL 0.0m", key: CauseKeys.WagesPaid);
+ var row = new Cause("city", "hadera", 0, "Hadera: jobs paid IL\u00A00.0m", key: CauseKeys.WagesPaid);
var missing = new Dictionary<string, string>();
var line = CauseText.Line(row, C, NoRows, He);
Assert.IsTrue(string.Equals(line, CauseText.Line(row, C, NoRows, He, missing), StringComparison.Ordinal));
@@ -221,7 +221,7 @@ public class CauseTextTests
[Test]
public void OtherLinesAreUnchanged()
{
- var plain = new Cause("economy", "treasury", -1, "Money IL -1.0m (military upkeep)");
+ var plain = new Cause("economy", "treasury", -1, "Money IL\u00A0-1.0m (military upkeep)");
Assert.AreEqual(plain.Message, CauseText.Line(plain, C, NoRows, He));
var turn = Turns().First(t => t.Why.Any(w => WhyKeys.All.Contains(w.Key)));
foreach (var w in turn.Why.Where(w => WhyKeys.All.Contains(w.Key)))
@@ -404,7 +404,7 @@ public class CauseTextTests
// including large counts, money rounding and Hebrew names. Actual producer metadata is gated in managed tests.
static Content RemainingFixture() => new Content
{
- Money = new List<MoneyAccount> { new MoneyAccount { Id = "treasury", Name = "Money", Prefix = "IL " }, new MoneyAccount { Id = "debt", Name = "Debt", Prefix = "IL " }, new MoneyAccount { Id = "fx_reserves", Name = "Foreign currency", Prefix = "$" } },
+ Money = new List<MoneyAccount> { new MoneyAccount { Id = "treasury", Name = "Money", Prefix = "IL\u00A0" }, new MoneyAccount { Id = "debt", Name = "Debt", Prefix = "IL\u00A0" }, new MoneyAccount { Id = "fx_reserves", Name = "Foreign currency", Prefix = "$" } },
SettlementNames = new Dictionary<string, string> { ["town"] = "Town" },
Sites = new List<Site> { new Site { Id = "site", Name = "Site", NameHe = "אתר" } },
Corridors = new List<CorridorDef> { new CorridorDef { Id = "road", Name = "Road", NameHe = "דרך" } },
@@ -419,29 +419,29 @@ public class CauseTextTests
static Cause[] RemainingRows() => new[]
{
new Cause("draft", "town", 1, "Town: 2000000000 groups in work", key: CauseKeys.WorkersAssigned, args: new[] { "2000000000" }),
- new Cause("draft", "town", 1.25, "Town: jobs paid IL +1.3m", key: CauseKeys.WagesPaid),
+ new Cause("draft", "town", 1.25, "Town: jobs paid IL\u00A0+1.3m", key: CauseKeys.WagesPaid),
new Cause("draft", "town", 3, "Town: 3 groups of immigrants housed", key: CauseKeys.ImmigrantsHoused, args: new[] { "3" }),
new Cause("draft", "town", 3, "Town: 3 groups more than its homes hold", key: CauseKeys.HousingShortage, args: new[] { "3" }),
new Cause("draft", "town", 3, "Town: 3 groups of immigrants arrived and wait for homes", key: CauseKeys.ImmigrantsWaiting, args: new[] { "3" }),
new Cause("draft", "units", 3, "Recruits became veteran soldiers", key: CauseKeys.RecruitsVeteran),
- new Cause("draft", "road", 1, "Road, segment 2: a group of halutzim began building, cost IL 1.3m", key: CauseKeys.CorridorStarted, args: new[] { "road", "2", "1.25" }),
+ new Cause("draft", "road", 1, "Road, segment 2: a group of halutzim began building, cost IL\u00A01.3m", key: CauseKeys.CorridorStarted, args: new[] { "road", "2", "1.25" }),
new Cause("draft", "road", -1, "Road, segment 2: the halutzim stopped building; the Money spent is not returned", key: CauseKeys.CorridorCancelled, args: new[] { "road", "2" }),
new Cause("draft", "road", 1, "Road, segment 2 built", key: CauseKeys.CorridorCompleted, args: new[] { "road", "2" }),
new Cause("draft", "site", 1, "A group of halutzim became veteran pioneers", key: CauseKeys.PioneersVeteran),
- new Cause("draft", "debt", 1.25, "Borrowed IL 1.3m to build a housing project", key: CauseKeys.MapBorrowed, args: new[] { "housing" }),
- new Cause("draft", "housing", 1, "Built a housing project: cost IL 1.3m, Housing +2.5%, Social cohesion -2.5%", key: CauseKeys.MapBuilt, args: new[] { "1.25", "0.025", "-0.025" }),
- new Cause("draft", "site", 1, "Site: a group of halutzim began plowing, cost IL 1.3m", key: CauseKeys.LandWorkStarted, args: new[] { "plow", "1.25" }),
- new Cause("draft", "site", 1, "Site: a group of halutzim began building a yishuv, cost IL 1.3m", key: CauseKeys.SiteStarted, args: new[] { "yishuv", "1.25" }),
+ new Cause("draft", "debt", 1.25, "Borrowed IL\u00A01.3m to build a housing project", key: CauseKeys.MapBorrowed, args: new[] { "housing" }),
+ new Cause("draft", "housing", 1, "Built a housing project: cost IL\u00A01.3m, Housing +2.5%, Social cohesion -2.5%", key: CauseKeys.MapBuilt, args: new[] { "1.25", "0.025", "-0.025" }),
+ new Cause("draft", "site", 1, "Site: a group of halutzim began plowing, cost IL\u00A01.3m", key: CauseKeys.LandWorkStarted, args: new[] { "plow", "1.25" }),
+ new Cause("draft", "site", 1, "Site: a group of halutzim began building a yishuv, cost IL\u00A01.3m", key: CauseKeys.SiteStarted, args: new[] { "yishuv", "1.25" }),
new Cause("draft", "site", -1, "Site: the halutzim stopped building; the Money spent is not returned", key: CauseKeys.SiteCancelled),
new Cause("draft", "site", 1, "Site founded", key: CauseKeys.SiteCompleted, args: new[] { "founded" }),
- new Cause("draft", "town", 1, "Town: Housing began, cost IL 1.3m", key: CauseKeys.ProjectStarted, args: new[] { "housing", "1.25" }),
+ new Cause("draft", "town", 1, "Town: Housing began, cost IL\u00A01.3m", key: CauseKeys.ProjectStarted, args: new[] { "housing", "1.25" }),
new Cause("draft", "town", -1, "Town: Housing was cancelled; the Money spent is not returned", key: CauseKeys.ProjectCancelled, args: new[] { "housing" }),
new Cause("draft", "town", 1, "Town: Housing was finished", key: CauseKeys.ProjectCompleted, args: new[] { "housing" }),
- new Cause("draft", "arms", 2000000000, "Bought 2000000000 Arms, cost IL 1.3m", key: CauseKeys.ArmsBought, args: new[] { "1.25" }),
+ new Cause("draft", "arms", 2000000000, "Bought 2000000000 Arms, cost IL\u00A01.3m", key: CauseKeys.ArmsBought, args: new[] { "1.25" }),
new Cause("draft", "town", 2, "Town: arms workshops staffed: 2", key: CauseKeys.WorkshopWorkers, args: new[] { "2" }),
new Cause("draft", "town", 1, "Town: an arms workshop made 1 Arms", key: CauseKeys.WorkshopArms),
new Cause("draft", "town", 0, "Town: an arms workshop has no worker without a job this month", key: CauseKeys.WorkshopPaused, args: new[] { Workshops.NoWorker }),
- new Cause("draft", "treasury", 1.44, "Converted $4.0m of foreign currency into Money: IL +1.4m", key: CauseKeys.DollarsConverted, args: new[] { "4" }),
+ new Cause("draft", "treasury", 1.44, "Converted $4.0m of foreign currency into Money: IL\u00A0+1.4m", key: CauseKeys.DollarsConverted, args: new[] { "4" }),
new Cause("draft", "food", 2000000000, "Site: the plowed land yielded 2000000000 units of Food", key: CauseKeys.FoodHarvest, args: new[] { "site" }),
new Cause("draft", "food", -2000000000, "Food ran out: 2000000000 of 2000000001 units of the month's need went unmet", key: CauseKeys.FoodShortage, args: new[] { "2000000001" }),
new Cause("draft", "food", -1, "No Food imported (foreign currency crisis): the stock fell to 2000000000 units", key: CauseKeys.FoodWithoutImports, args: new[] { "2000000000" }),
@@ -451,7 +451,7 @@ public class CauseTextTests
new Cause("draft", "town", -3, "Town: 3 groups of qualified craftsmen are craftsmen again", key: CauseKeys.CraftsmenReassigned, args: new[] { "3" }),
new Cause("draft", "42", 1, "Unit 42 returned to civilian life in Town and keeps its training", key: CauseKeys.PioneerReturned, args: new[] { "town" }),
new Cause("draft", "town", -3, "Town: 3 groups of qualified veteran pioneers are units again", key: CauseKeys.PioneersReassigned, args: new[] { "3", "veteran" }),
- new Cause("draft", "town", -3, "Town: 3 groups began basic training as replacements for unit 42, cost IL 1.3m", key: CauseKeys.TrainingStarted, args: new[] { "3", "basic", "42", "1.25" }),
+ new Cause("draft", "town", -3, "Town: 3 groups began basic training as replacements for unit 42, cost IL\u00A01.3m", key: CauseKeys.TrainingStarted, args: new[] { "3", "basic", "42", "1.25" }),
new Cause("draft", "arms", -3, "Town: basic training took 3 Arms", key: CauseKeys.TrainingArms, args: new[] { "town", "basic" }),
new Cause("draft", "town", 3, "Town: 3 groups left basic training; the Money spent is not returned", key: CauseKeys.TrainingCancelled, args: new[] { "3", "basic" }),
new Cause("draft", "arms", 3, "Town: basic training returned 3 Arms", key: CauseKeys.TrainingArmsReturned, args: new[] { "town", "basic" }),
@@ -480,7 +480,7 @@ public class CauseTextTests
new Cause("draft", "town", 0, "Town: Israeli units withdrew and it is under enemy control again. Its residents fled when it was captured", key: CauseKeys.PlaceWithdrawn, args: new[] { "1", "1" }),
new Cause("draft", "town", 0, "Town: Deport. Its residents are displaced and the place is depopulated", key: CauseKeys.PlaceDeported),
new Cause("draft", "morale", -0.025, "Social cohesion -2.5% (Deport of Town)", key: CauseKeys.DeportEffect, args: new[] { "town" }),
- new Cause("draft", "treasury", -1.25, "Money IL -1.3m (Deport of Town)", key: CauseKeys.DeportCost, args: new[] { "town" }),
+ new Cause("draft", "treasury", -1.25, "Money IL\u00A0-1.3m (Deport of Town)", key: CauseKeys.DeportCost, args: new[] { "town" }),
new Cause("draft", "town", 3, "Town is occupied for 3 turns: an Israeli unit stays there. Its residents fled when it was captured", key: CauseKeys.OccupationStarted, args: new[] { "1" }),
new Cause("draft", "town", 0, "Town: no decision was made before the game ended, so it counts as a raid", key: CauseKeys.PendingBecameRaid),
new Cause("draft", "town", 0, "Town: no Israeli unit holds it any more, so the occupation ended as a raid. It is under enemy control again. Its residents fled when it was captured", key: CauseKeys.OccupationLostUnit, args: new[] { "1" }),
@@ -547,9 +547,9 @@ public class CauseTextTests
new Cause("draft", "town", 0, "Town: the occupation period has ended. It awaits a decision", key: CauseKeys.OccupationCountdown),
new Cause("draft", "office", 0, "Person appointed Office", key: CauseKeys.Appointed, args: new[] { "person", "התפקיד שנשמר", "" }),
new Cause("draft", "coalition_stability", -0.025, "Coalition stability -2.5% (Former resents the reshuffle)", key: CauseKeys.Reshuffle, args: new[] { "", "former", "same", "Office", "התפקיד שנשמר" }),
- new Cause("draft", "town", -1, "Town: 1 group began armoured car training, cost IL 1.3m", key: CauseKeys.TrainingStarted, args: new[] { "1", "armour", "", "1.25" }),
- new Cause("draft", "site", 1, "Site: a group of halutzim began draining the swamp, cost IL 1.3m", key: CauseKeys.LandWorkStarted, args: new[] { "drain", "1.25" }),
- new Cause("draft", "site", 1, "Site: a group of halutzim began building a training camp, cost IL 1.3m", key: CauseKeys.SiteStarted, args: new[] { "camp", "1.25" }),
+ new Cause("draft", "town", -1, "Town: 1 group began armoured car training, cost IL\u00A01.3m", key: CauseKeys.TrainingStarted, args: new[] { "1", "armour", "", "1.25" }),
+ new Cause("draft", "site", 1, "Site: a group of halutzim began draining the swamp, cost IL\u00A01.3m", key: CauseKeys.LandWorkStarted, args: new[] { "drain", "1.25" }),
+ new Cause("draft", "site", 1, "Site: a group of halutzim began building a training camp, cost IL\u00A01.3m", key: CauseKeys.SiteStarted, args: new[] { "camp", "1.25" }),
new Cause("draft", "town", 0, "Town: an arms workshop's next cycle waits: paying for it would take the debt past its ceiling", key: CauseKeys.WorkshopPaused, args: new[] { Workshops.DebtCeiling }), // #1701 OQ4
};
// A renderer receives no live state: both resident variants must survive the settlement record's removal.
diff --git a/unity/Assets/Tests/EditMode/DefenceScreenTests.cs b/unity/Assets/Tests/EditMode/DefenceScreenTests.cs
index fd8857963..4ea10da15 100644
--- a/unity/Assets/Tests/EditMode/DefenceScreenTests.cs
+++ b/unity/Assets/Tests/EditMode/DefenceScreenTests.cs
@@ -64,7 +64,7 @@ public class DefenceScreenTests
Assert.AreEqual(DisplayStyle.None, ui.Q<Label>("ceasefire").style.display.value); // no clock in the GDD loop (R-WAR-003)
Assert.AreEqual("Minister of Defense David Ben-Gurion · Chief of Staff Yaakov Dori", ui.Q<Label>("defence-command").text);
Assert.AreEqual("80% of reserves called up (level 5 needs at least 80%)", ui.Q<Label>("mob-level").text);
- Assert.AreEqual("Costs IL 48.0m a year in pay and lost work", ui.Q<Label>("mob-cost").text);
+ Assert.AreEqual("Costs IL\u00A048.0m a year in pay and lost work", ui.Q<Label>("mob-cost").text);
Assert.IsFalse(ui.Q<Button>("escalate").enabledSelf);
}
}
@@ -116,7 +116,7 @@ public class DefenceScreenTests
Assert.AreEqual(0.4, bridge.State.Mobilization, 1e-9);
ui.Press("escalate"); // back to full war needs 80% again
StringAssert.StartsWith("80% of reserves called up (level 5 needs at least 80%)", ui.Q<Label>("mob-level").text);
- Assert.AreEqual("Costs IL 48.0m a year in pay and lost work", ui.Q<Label>("mob-cost").text);
+ Assert.AreEqual("Costs IL\u00A048.0m a year in pay and lost work", ui.Q<Label>("mob-cost").text);
bridge.EndTurn();
Assert.AreEqual(0.8, bridge.State.Mobilization, 1e-9);
Assert.AreEqual(5, bridge.State.Rung);
diff --git a/unity/Assets/Tests/EditMode/EventEffectTextTests.cs b/unity/Assets/Tests/EditMode/EventEffectTextTests.cs
index 41ac14cfc..d04b882ce 100644
--- a/unity/Assets/Tests/EditMode/EventEffectTextTests.cs
+++ b/unity/Assets/Tests/EditMode/EventEffectTextTests.cs
@@ -71,14 +71,14 @@ public class EventEffectTextTests
// English data names are deliberate fallbacks: current indicator/city/policy rows have no Hebrew field.
var expected = hebrew ? new[]
{
- "Social cohesion: שינוי +4.1%", "Money: שינוי IL -1.3m", "מזון +3 יחידות", "נשק -100 יחידות",
+ "Social cohesion: שינוי +4.1%", "Money: שינוי IL\u00A0-1.3m", "מזון +3 יחידות", "נשק -100 יחידות",
"חלוצים: 2, מיקום: " + Place, "מגויסים: 1, מיקום: " + Place,
"חלוצים ותיקים: 3, מיקום: " + Place, "יחידות: 4, מיקום: " + Place,
Place + ": קיבולת דיור, שינוי +3", Place + ": מקומות עבודה, שינוי -100", Place + ": מצב הדיור, שינוי +5.1%",
"Housing construction: ערך חדש 75%", "רמת הביטחון תיקבע ל־4", "חזרה למסלול ההיסטורי: " + title,
} : new[]
{
- "Social cohesion +4.1%", "Money IL -1.3m", "Food +3 units", "Arms -100 units",
+ "Social cohesion +4.1%", "Money IL\u00A0-1.3m", "Food +3 units", "Arms -100 units",
"Halutzim: 2 at " + Place, "Recruits: 1 at " + Place,
"Veteran Halutzim: 3 at " + Place, "Units: 4 at " + Place,
Place + ": housing capacity +3", Place + ": job slots -100", Place + ": housing condition +5.1%",
@@ -114,7 +114,7 @@ public class EventEffectTextTests
var mark = UiText.LeftToRightMark.ToString();
StringAssert.Contains(mark + "-100" + mark, EventEffectText.Format(rows[3], Text(true)));
StringAssert.Contains(mark + "+5.1%" + mark, EventEffectText.Format(rows[10], Text(true)));
- StringAssert.Contains(mark + "IL -1.3m" + mark, EventEffectText.Format(rows[1], Text(true), "אוצר"));
+ Assert.That(EventEffectText.Format(rows[1], Text(true), "אוצר").IndexOf(mark + "IL\u00A0-1.3m" + mark, StringComparison.Ordinal) >= 0);
}
// A project unlock (R-EFX-008) is one of the helper's entries too, so it has a template; the Hebrew kind name comes
diff --git a/unity/Assets/Tests/EditMode/HebrewUiTests.cs b/unity/Assets/Tests/EditMode/HebrewUiTests.cs
index 56fd7b98f..f8c40083a 100644
--- a/unity/Assets/Tests/EditMode/HebrewUiTests.cs
+++ b/unity/Assets/Tests/EditMode/HebrewUiTests.cs
@@ -372,7 +372,7 @@ public class HebrewUiTests
{
foreach (var s in new[] { "תור 1", "5 מלחמה כוללת", "קואליציה: 30 מתוך 37", "‏…אנו", "العربية" })
Assert.IsTrue(UiDirection.RightToLeft(s), s);
- foreach (var s in new[] { "15 May 1948", "IL 20.0m", "+5%", "-5%", "30%", "", "David Ben-Gurion", "Mapai :מפלגה", "$40.0m", "1948" })
+ foreach (var s in new[] { "15 May 1948", "IL\u00A020.0m", "+5%", "-5%", "30%", "", "David Ben-Gurion", "Mapai :מפלגה", "$40.0m", "1948" })
Assert.IsFalse(UiDirection.RightToLeft(s), s);
Assert.IsFalse(UiDirection.RightToLeft(null));
}
diff --git a/unity/Assets/Tests/EditMode/HebrewValuesTests.cs b/unity/Assets/Tests/EditMode/HebrewValuesTests.cs
index eb2b1e0f2..ff3e6de88 100644
--- a/unity/Assets/Tests/EditMode/HebrewValuesTests.cs
+++ b/unity/Assets/Tests/EditMode/HebrewValuesTests.cs
@@ -31,8 +31,8 @@ public class HebrewValuesTests
[Test]
public void AValueInAHebrewTemplateIsWrappedInLeftToRightMarks()
{
- Assert.AreEqual("כסף " + Lrm + "$12.0m" + Lrm + " · חוב " + Lrm + "IL 3.0m" + Lrm + " · מטבע חוץ " + Lrm + "$-4.2m" + Lrm,
- He.Format("budget.money", "$12.0m", "IL 3.0m", "$-4.2m"));
+ Assert.AreEqual("כסף " + Lrm + "$12.0m" + Lrm + " · חוב " + Lrm + "IL\u00A03.0m" + Lrm + " · מטבע חוץ " + Lrm + "$-4.2m" + Lrm,
+ He.Format("budget.money", "$12.0m", "IL\u00A03.0m", "$-4.2m"));
Assert.AreEqual("מ־" + Lrm + "15 May 1948" + Lrm + " עד " + Lrm + "1 June 1948" + Lrm, He.Format("why.turn", "15 May 1948", "1 June 1948"));
// A format item keeps its format: the value is formatted, then wrapped.
Assert.AreEqual("תשומת לב " + Lrm + "2.5" + Lrm + " מתוך " + Lrm + "10.0" + Lrm, He.Format("hud.attention", 2.5, 10.0));
@@ -72,10 +72,10 @@ public class HebrewValuesTests
var appointed = He.Format("card.appointed_name", "דוד בן־גוריון");
Assert.AreEqual("דוד בן־גוריון (מינוי שלך)", appointed);
Assert.IsTrue(UiDirection.RightToLeft(appointed), appointed);
- var amount = He.Format("hud.say_million", "IL -", "3.0");
- Assert.AreEqual(Lrm + "IL -" + Lrm + Lrm + "3.0" + Lrm + " מיליון", amount);
- Assert.AreEqual("כסף: " + amount + ", קיטון של " + Lrm + "IL " + Lrm + Lrm + "4.0" + Lrm + " מיליון מאז התור הקודם",
- He.Format("hud.say_down", "כסף", amount, He.Format("hud.say_million", "IL ", "4.0")));
+ var amount = He.Format("hud.say_million", "IL\u00A0-", "3.0");
+ Assert.AreEqual(Lrm + "IL\u00A0-" + Lrm + Lrm + "3.0" + Lrm + " מיליון", amount);
+ Assert.AreEqual("כסף: " + amount + ", קיטון של " + Lrm + "IL\u00A0" + Lrm + Lrm + "4.0" + Lrm + " מיליון מאז התור הקודם",
+ He.Format("hud.say_down", "כסף", amount, He.Format("hud.say_million", "IL\u00A0", "4.0")));
}
/// <summary>A template with no letter of its own ("{0} {1}", "{0:N0}") is neither language: its values are left alone,
@@ -112,7 +112,7 @@ public class HebrewValuesTests
var en = En;
var keys = Keys(UiPaths.Strings);
Assert.Greater(keys.Count, 100, "the keys are read");
- var args = new object[] { "$-4.2m", "15 May 1948", 2.5, 46, "IL 3.0m", "Mapai", 7, 1948 };
+ var args = new object[] { "$-4.2m", "15 May 1948", 2.5, 46, "IL\u00A03.0m", "Mapai", 7, 1948 };
foreach (var key in keys)
{
string expected;
@@ -122,7 +122,7 @@ public class HebrewValuesTests
CollectionAssert.AreEqual(Encoding.UTF8.GetBytes(expected), Encoding.UTF8.GetBytes(got), key);
Assert.AreEqual(-1, got.IndexOf(Lrm, StringComparison.Ordinal), key);
}
- Assert.AreEqual("Money $12.0m · debt IL 3.0m · foreign currency $-4.2m", en.Format("budget.money", "$12.0m", "IL 3.0m", "$-4.2m"));
+ Assert.AreEqual("Money $12.0m · debt IL\u00A03.0m · foreign currency $-4.2m", en.Format("budget.money", "$12.0m", "IL\u00A03.0m", "$-4.2m"));
Assert.AreEqual("15 May 1948 to 1 June 1948", en.Format("why.turn", "15 May 1948", "1 June 1948"));
}
@@ -133,7 +133,7 @@ public class HebrewValuesTests
public void TakingTheMarksOutOfAnyHebrewLineGivesTheOldTextBack()
{
var he = He;
- var args = new object[] { "$-4.2m", "15 May 1948", 2.5, 46, "IL 3.0m", "Mapai", 7, 1948 };
+ var args = new object[] { "$-4.2m", "15 May 1948", 2.5, 46, "IL\u00A03.0m", "Mapai", 7, 1948 };
int wrapped = 0, joined = 0;
foreach (var key in Keys(UiPaths.StringsHebrew))
{
@@ -444,7 +444,7 @@ public class HebrewValuesTests
public IEnumerator InAHebrewLineTheDollarLeadsItsMinusAndTheDateIsOneRun()
{
using var r = new Rendered(
- He.Format("budget.money", "$12.0m", "IL 3.0m", "$-4.2m"),
+ He.Format("budget.money", "$12.0m", "IL\u00A03.0m", "$-4.2m"),
He.Format("why.turn", "15 May 1948", "1 June 1948"),
"15 May 1948");
yield return r.Draw();
diff --git a/unity/Assets/Tests/EditMode/HudTests.cs b/unity/Assets/Tests/EditMode/HudTests.cs
index d486c0da7..82670969d 100644
--- a/unity/Assets/Tests/EditMode/HudTests.cs
+++ b/unity/Assets/Tests/EditMode/HudTests.cs
@@ -25,12 +25,12 @@ public class HudTests
{
var why = new List<Cause>
{
- new Cause("economy", "treasury", -0.4, "Money IL -0.4m (military upkeep)", key: CauseKeys.MilitaryUpkeep),
- new Cause("city", "tel_aviv", 0.53, "Tel Aviv: jobs paid IL +0.5m", key: CauseKeys.WagesPaid),
- new Cause("economy", "debt", 9, "Borrowed IL 9.0m to cover the deficit", key: CauseKeys.Borrowed, args: new[] { CauseKeys.Purpose.Deficit }),
+ new Cause("economy", "treasury", -0.4, "Money IL\u00A0-0.4m (military upkeep)", key: CauseKeys.MilitaryUpkeep),
+ new Cause("city", "tel_aviv", 0.53, "Tel Aviv: jobs paid IL\u00A0+0.5m", key: CauseKeys.WagesPaid),
+ new Cause("economy", "debt", 9, "Borrowed IL\u00A09.0m to cover the deficit", key: CauseKeys.Borrowed, args: new[] { CauseKeys.Purpose.Deficit }),
};
var turn = new StepResult(new GameState(), why, new Rejection[0]);
- CollectionAssert.AreEqual(new[] { "Tel Aviv: jobs paid IL +0.5m", "Money IL -0.4m (military upkeep)" },
+ CollectionAssert.AreEqual(new[] { "Tel Aviv: jobs paid IL\u00A0+0.5m", "Money IL\u00A0-0.4m (military upkeep)" },
HudModel.Causes(turn, "treasury", C, w => w.Message));
var b = NewBridge();
@@ -45,18 +45,18 @@ public class HudTests
public void MoneyShowsTheTwoLargestCausesAndOneOtherLineForTheRest()
{
Cause Money(double d, string what) => new Cause("economy", "treasury", d, PlayerText.Change(C, "treasury", d) + " (" + what + ")", key: CauseKeys.MilitaryUpkeep);
- var borrowing = new Cause("economy", "debt", 9, "Borrowed IL 9.0m to cover the deficit", key: CauseKeys.Borrowed, args: new[] { CauseKeys.Purpose.Deficit });
+ var borrowing = new Cause("economy", "debt", 9, "Borrowed IL\u00A09.0m to cover the deficit", key: CauseKeys.Borrowed, args: new[] { CauseKeys.Purpose.Deficit });
IReadOnlyList<string> Lines(string meter, params Cause[] why) =>
HudModel.Causes(new StepResult(new GameState(), why.Append(borrowing).ToList(), new Rejection[0]), meter, C, w => w.Message);
var a = Money(-3, "a"); var b = Money(2, "b");
- CollectionAssert.AreEqual(new[] { "Money IL -3.0m (a)", "Money IL +2.0m (b)", "Money IL -0.3m (other causes)" },
+ CollectionAssert.AreEqual(new[] { "Money IL\u00A0-3.0m (a)", "Money IL\u00A0+2.0m (b)", "Money IL\u00A0-0.3m (other causes)" },
Lines("treasury", Money(0.1, "d"), a, Money(-0.4, "c"), b), "three or more causes: the two largest, then the rest");
- CollectionAssert.AreEqual(new[] { "Money IL -3.0m (a)", "Money IL +2.0m (b)" }, Lines("treasury", a, b), "two causes: no Other line");
- CollectionAssert.AreEqual(new[] { "Money IL -3.0m (a)" }, Lines("treasury", a), "one cause: no Other line");
- CollectionAssert.AreEqual(new[] { "Money IL -3.0m (a)", "Money IL +2.0m (b)" }, Lines("treasury", a, b, Money(0.04, "c")),
- "the rest shows as IL 0.0m: no Other line");
- CollectionAssert.AreEqual(new[] { "Money IL -3.0m (a)", "Money IL +2.0m (b)" }, Lines("treasury", a, b, Money(1, "c"), Money(-1, "d")),
+ CollectionAssert.AreEqual(new[] { "Money IL\u00A0-3.0m (a)", "Money IL\u00A0+2.0m (b)" }, Lines("treasury", a, b), "two causes: no Other line");
+ CollectionAssert.AreEqual(new[] { "Money IL\u00A0-3.0m (a)" }, Lines("treasury", a), "one cause: no Other line");
+ CollectionAssert.AreEqual(new[] { "Money IL\u00A0-3.0m (a)", "Money IL\u00A0+2.0m (b)" }, Lines("treasury", a, b, Money(0.04, "c")),
+ "the rest shows as IL\u00A00.0m: no Other line");
+ CollectionAssert.AreEqual(new[] { "Money IL\u00A0-3.0m (a)", "Money IL\u00A0+2.0m (b)" }, Lines("treasury", a, b, Money(1, "c"), Money(-1, "d")),
"the rest cancels out: no Other line");
Cause Security(double d) => new Cause("events", "security", d, PlayerText.Change(C, "security", d));
Assert.AreEqual(HudModel.MaxCauses, Lines("security", Security(0.03), Security(0.02), Security(0.01)).Count, "only Money gets an Other line");
@@ -78,7 +78,7 @@ public class HudTests
Assert.AreEqual("1948", m.Year);
Assert.AreEqual("Turn 0", m.Turn);
Assert.AreEqual("15 May 1948", m.Date);
- Assert.AreEqual("IL 20.0m", m.Treasury.Value); // Israeli pounds (playtest 1, item 7)
+ Assert.AreEqual("IL\u00A020.0m", m.Treasury.Value); // Israeli pounds (playtest 1, item 7)
Assert.AreEqual("$40.0m", m.Fx.Value);
Assert.AreEqual("30%", m.Security.Value); // the 0-100 scale, with its unit (fix round 1, I2)
Assert.AreEqual("50%", m.Standing.Value);
@@ -143,7 +143,7 @@ public class HudTests
Assert.Greater(bridge.State.Debt, 0.0);
var m = HudModel.From(bridge, Text);
Assert.AreEqual(PlayerText.Money(C, "treasury", -bridge.State.Debt), m.Treasury.Value);
- StringAssert.Contains("IL -", m.Treasury.Value);
+ Assert.That(m.Treasury.Value.IndexOf("IL\u00A0-", System.StringComparison.Ordinal) >= 0);
}
/// <summary>#681 (owner, 16 October 2026: "keep one top-bar figure and label it as net (cash minus debt)"): the Money
@@ -163,7 +163,7 @@ public class HudTests
Assert.AreEqual(caption, meter.Q<Label>(className: "meter-name").text);
StringAssert.StartsWith(caption + ":", meter.tooltip);
Assert.AreEqual(PlayerText.Money(C, "treasury", bridge.State.Treasury - bridge.State.Debt), ui.Q<Label>("treasury-value").text);
- StringAssert.Contains("IL -", ui.Q<Label>("treasury-value").text);
+ Assert.That(ui.Q<Label>("treasury-value").text.IndexOf("IL\u00A0-", System.StringComparison.Ordinal) >= 0);
}
// ---- The score (#380): only in the GDD loop, from GameState.Score ----
@@ -591,7 +591,7 @@ public class HudTests
var now = bridge.State;
prev.Treasury = now.Treasury - now.Debt + prev.Debt - 5; // up by 5
hud.Render();
- Assert.AreEqual("IL +5.0m", ui.Q<Label>("treasury-delta").text);
+ Assert.AreEqual("IL\u00A0+5.0m", ui.Q<Label>("treasury-delta").text);
Assert.IsTrue(ui.Q<Label>("treasury-delta").ClassListContains("delta-up"));
Assert.IsFalse(ui.Q<Label>("treasury-delta").ClassListContains("delta-down"));
prev.Treasury = now.Treasury - now.Debt + prev.Debt + 0.04; // down by 0.04: rounds to zero, never "-0.0"
@@ -796,7 +796,7 @@ public class HudTests
var m = HudModel.From(bridge, Text);
Assert.AreEqual("$-2.0m", m.Fx.Delta);
Assert.AreEqual("+5%", m.Security.Delta);
- Assert.AreEqual("IL -3.0m", m.Treasury.Delta);
+ Assert.AreEqual("IL\u00A0-3.0m", m.Treasury.Delta);
}
/// <summary>Fix round 2 (N4, N5): no script rescales a sim number for display itself: 0..1 values go through
@@ -916,7 +916,7 @@ public class HudTests
using var ui = new UiTestKit();
var bridge = NewBridge();
var hud = new HudPresenter(ui.Root, bridge, Text);
- Assert.AreEqual("Money (net): IL 20.0 million", ui.Q<VisualElement>("meter-treasury").tooltip); // turn 0: no change
+ Assert.AreEqual("Money (net): IL\u00A020.0 million", ui.Q<VisualElement>("meter-treasury").tooltip); // turn 0: no change
Assert.AreEqual("Foreign currency: $40.0 million", ui.Q<VisualElement>("meter-fx").tooltip);
Assert.AreEqual("Security: 30%", ui.Q<VisualElement>("meter-security").tooltip);
bridge.EndTurn();
@@ -928,7 +928,7 @@ public class HudTests
hud.Render();
var net = System.Math.Round(now.Treasury - now.Debt, 1, System.MidpointRounding.AwayFromZero);
Assert.Greater(net, 0, "the test expects a positive net position after one turn");
- Assert.AreEqual(Inv($"Money (net): IL {net:0.0} million, down IL 1.4 million since last turn"), ui.Q<VisualElement>("meter-treasury").tooltip);
+ Assert.AreEqual(Inv($"Money (net): IL\u00A0{net:0.0} million, down IL\u00A01.4 million since last turn"), ui.Q<VisualElement>("meter-treasury").tooltip);
Assert.AreEqual(Inv($"Foreign currency: ${now.FxReserves:0.0} million, up $2.0 million since last turn"), ui.Q<VisualElement>("meter-fx").tooltip);
Assert.AreEqual($"Security: {ui.Q<Label>("security-value").text}, up 5 points since last turn", ui.Q<VisualElement>("meter-security").tooltip);
Assert.AreEqual($"International support: {ui.Q<Label>("standing-value").text}, down 1 point since last turn", ui.Q<VisualElement>("meter-standing").tooltip);
@@ -982,14 +982,14 @@ public class HudTests
now.Debt = now.Treasury + 3; // net -3.0
prev.Debt = prev.Treasury - 1; // net +1.0 before: down by 4
m = HudModel.From(bridge, Text);
- Assert.AreEqual("Money: IL -3.0 million, down IL 4.0 million since last turn", HudModel.Spoken(Text, "Money", m.Treasury));
+ Assert.AreEqual("Money: IL\u00A0-3.0 million, down IL\u00A04.0 million since last turn", HudModel.Spoken(Text, "Money", m.Treasury));
using var ui = new UiTestKit();
var he = He;
new HudPresenter(ui.Root, bridge, he);
var said = ui.Q<VisualElement>("meter-treasury").tooltip;
// The values carry left-to-right marks (U+200E, #543), so the value stays one left-to-right run - "IL -3.0" with the minus next to the number - in a right-to-left line.
- Assert.AreEqual("כסף (נטו): \u200EIL -\u200E\u200E3.0\u200E מיליון, קיטון של \u200EIL \u200E\u200E4.0\u200E מיליון מאז התור הקודם", said);
- Assert.AreEqual("כסף (נטו): IL -3.0 מיליון, קיטון של IL 4.0 מיליון מאז התור הקודם", said.Replace("\u200E", ""));
+ Assert.AreEqual("כסף (נטו): \u200EIL\u00A0-\u200E\u200E3.0\u200E מיליון, קיטון של \u200EIL\u00A0\u200E\u200E4.0\u200E מיליון מאז התור הקודם", said);
+ Assert.AreEqual("כסף (נטו): IL\u00A0-3.0 מיליון, קיטון של IL\u00A04.0 מיליון מאז התור הקודם", said.Replace("\u200E", ""));
foreach (var id in MeterIds)
{
var tip = ui.Q<VisualElement>("meter-" + id).tooltip;
diff --git a/unity/Assets/Tests/EditMode/MapActionUiTests.cs b/unity/Assets/Tests/EditMode/MapActionUiTests.cs
index dacc1ffb6..38b233324 100644
--- a/unity/Assets/Tests/EditMode/MapActionUiTests.cs
+++ b/unity/Assets/Tests/EditMode/MapActionUiTests.cs
@@ -91,7 +91,7 @@ public class MapActionUiTests
var tlv = C.SettlementHexes.Single(s => s.Id == "tel_aviv");
info.Show(tlv.Q, tlv.R);
Assert.IsTrue(ui.Q<Button>("build-camp").enabledSelf, ui.Q<Label>("info-reason").text);
- Assert.AreEqual("Place a transit camp (IL 1.5m)", ui.Q<Button>("build-camp").text);
+ Assert.AreEqual("Place a transit camp (IL\u00A01.5m)", ui.Q<Button>("build-camp").text);
ui.Press("build-camp");
Assert.AreEqual("Ordered: A transit camp, at End turn", ui.Q<Label>("info-placement").text);
bridge.EndTurn();