diff --git a/CHANGELOG.md b/CHANGELOG.md index b3ee3db0..e5b95de1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed +- Fixed a test that failed when run on a computer with german culture - Update the minimum Unity version to 2021.3. - Fixed a bug where line pauses could sometimes not happen when the user's framerate is low. - Fixed a bug where the Rounded Views sample wouldn't import correctly. diff --git a/Tests/Runtime/DialogueRunnerTests/DialogueRunnerTests.cs b/Tests/Runtime/DialogueRunnerTests/DialogueRunnerTests.cs index 18c80669..d76d86c3 100644 --- a/Tests/Runtime/DialogueRunnerTests/DialogueRunnerTests.cs +++ b/Tests/Runtime/DialogueRunnerTests/DialogueRunnerTests.cs @@ -490,7 +490,10 @@ public IEnumerator VariableStorage_OnExternalChanges_ReturnsExpectedValue() { runner.StartDialogue("BuiltinsTest"); yield return null; - Assert.AreEqual("Jane: round(3.522) = 4; round_places(3.522, 2) = 3.52; floor(3.522) = 3; floor(-3.522) = -4; ceil(3.522) = 4; ceil(-3.522) = -3; inc(3.522) = 4; inc(4) = 5; dec(3.522) = 3; dec(3) = 2; round_places(decimal(3.522),3) = 0.522; int(3.522) = 3; int(-3.522) = -3;", dialogueUI.CurrentLine); + // we need to format the expected values with the current culture, because "3.52" is formatted as "3,52" in some cultures. + var round_places = $"{3.52:0.00}"; + var round_places_decimal = $"{0.522:0.000}"; + Assert.AreEqual($"Jane: round(3.522) = 4; round_places(3.522, 2) = {round_places}; floor(3.522) = 3; floor(-3.522) = -4; ceil(3.522) = 4; ceil(-3.522) = -3; inc(3.522) = 4; inc(4) = 5; dec(3.522) = 3; dec(3) = 2; round_places(decimal(3.522),3) = {round_places_decimal}; int(3.522) = 3; int(-3.522) = -3;", dialogueUI.CurrentLine); // dialogueUI.ReadyForNextLine(); }