Skip to content

Commit 01ad2e0

Browse files
committed
Improve a test for LogMessage
1 parent d263de8 commit 01ad2e0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Tests/MentionTest/TryFormat.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ public void GuildEmoji()
152152
[TestMethod]
153153
public void LogMessage()
154154
{
155+
// Sleep until the next second to ensure the timestamp is the same for all messages
156+
var now = DateTime.Now;
157+
var milliseconds = 1000 - now.Millisecond;
158+
Thread.Sleep(milliseconds);
159+
155160
TestTryFormat(TryFormat, _messages, m => m.ToString());
156161

157162
static bool TryFormat(Span<char> destination, out int charsWritten, LogMessage value) => value.TryFormat(destination, out charsWritten);

0 commit comments

Comments
 (0)