From 7c9a78b19487d0a7feee4deb52a645b98b564d83 Mon Sep 17 00:00:00 2001 From: Jesse McGrew Date: Fri, 30 Oct 2020 15:26:54 -0700 Subject: [PATCH] Use TranslateString instead of ToStringContext for the DESC pseudo-property. [ZILF-222] --- src/Zilf/Compiler/Compilation.Objects.cs | 2 +- test/Zilf.Tests.Integration/ObjectTests.cs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Zilf/Compiler/Compilation.Objects.cs b/src/Zilf/Compiler/Compilation.Objects.cs index a5272c7..91acf23 100644 --- a/src/Zilf/Compiler/Compilation.Objects.cs +++ b/src/Zilf/Compiler/Compilation.Objects.cs @@ -574,7 +574,7 @@ namespace Zilf.Compiler Context.HandleError(new CompilerError(model, CompilerMessages.Values_For_0_Property_Must_Be_1, propName, "strings")); continue; } - ob.DescriptiveName = value.ToStringContext(Context, true); + ob.DescriptiveName = TranslateString((ZilString)value, Context); // skip the length validation continue; diff --git a/test/Zilf.Tests.Integration/ObjectTests.cs b/test/Zilf.Tests.Integration/ObjectTests.cs index 732e620..0b92128 100644 --- a/test/Zilf.Tests.Integration/ObjectTests.cs +++ b/test/Zilf.Tests.Integration/ObjectTests.cs @@ -564,5 +564,14 @@ namespace Zilf.Tests.Integration .WithoutWarnings() .DoesNotCompile(); } + + [TestMethod] + public void DESC_Pseudo_Property_Should_Be_Stripped_Of_Newlines() + { + AssertRoutine("", + "") + .WithGlobal("") + .Outputs("first second third"); + } } } -- GitLab