diff --git a/test/Serilog.Tests/Formatting/Display/MessageTemplateTextFormatterTests.cs b/test/Serilog.Tests/Formatting/Display/MessageTemplateTextFormatterTests.cs index fd1de16f0..c23298f34 100644 --- a/test/Serilog.Tests/Formatting/Display/MessageTemplateTextFormatterTests.cs +++ b/test/Serilog.Tests/Formatting/Display/MessageTemplateTextFormatterTests.cs @@ -48,6 +48,19 @@ public void LowercaseFormatSpecifierIsSupportedForStrings() Assert.Equal("nick", sw.ToString()); } + [Theory] + [InlineData(16)] + [InlineData(100)] + public void RendersTimestampFormatsOfDifferentLengths(int length) + { + var longFormatString = new string('-', length); + var formatter = new MessageTemplateTextFormatter($"{{Timestamp:{longFormatString}}}", CultureInfo.InvariantCulture); + var evt = DelegatingSink.GetLogEvent(l => l.Information("{Name}", "Nick")); + var sw = new StringWriter(); + formatter.Format(evt, sw); + Assert.Contains(longFormatString, sw.ToString()); + } + [Theory] [InlineData(Verbose, 1, "V")] [InlineData(Verbose, 2, "Vb")]