You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by fr...@apache.org on 2025/05/22 10:35:29 UTC
(logging-log4net) branch Feature/248-DateTimeFormattersFix created (now 6f9b7116)
This is an automated email from the ASF dual-hosted git repository.
freeandnil pushed a change to branch Feature/248-DateTimeFormattersFix
in repository https://gitbox.apache.org/repos/asf/logging-log4net.git
at 6f9b7116 added tests for #247
This branch includes the following new commits:
new 6f9b7116 added tests for #247
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(logging-log4net) 01/01: added tests for #247
Posted by fr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
freeandnil pushed a commit to branch Feature/248-DateTimeFormattersFix
in repository https://gitbox.apache.org/repos/asf/logging-log4net.git
commit 6f9b7116993d6353e6587e579bc3d2f4269b97fe
Author: Jan Friedrich <fr...@apache.org>
AuthorDate: Thu May 22 12:35:06 2025 +0200
added tests for #247
---
.../DateFormatter/AbsoluteTimeDateFormatterTest.cs | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/src/log4net.Tests/DateFormatter/AbsoluteTimeDateFormatterTest.cs b/src/log4net.Tests/DateFormatter/AbsoluteTimeDateFormatterTest.cs
index ddc774e1..0a7aeb8a 100644
--- a/src/log4net.Tests/DateFormatter/AbsoluteTimeDateFormatterTest.cs
+++ b/src/log4net.Tests/DateFormatter/AbsoluteTimeDateFormatterTest.cs
@@ -99,6 +99,23 @@ public void TestFormattingResults()
Assert.That(sb.ToString(), Is.EqualTo("11:59:59,100"));
sb.Clear();
}
+
+ [Test]
+ public void FormatTwoPatternsTest()
+ {
+ AbsoluteTimeDateFormatter absolute = new();
+ Iso8601DateFormatter iso = new();
+ StringBuilder sb = new();
+ using StringWriter writer = new(sb, CultureInfo.InvariantCulture);
+
+ absolute.FormatDate(new DateTime(1970, 1, 1, 1, 1, 1).AddMilliseconds(1), writer);
+ Assert.That(sb.ToString(), Is.EqualTo("01:01:01,001"));
+ sb.Clear();
+
+ iso.FormatDate(new DateTime(1970, 1, 1, 1, 1, 1).AddMilliseconds(1), writer);
+ Assert.That(sb.ToString(), Is.EqualTo("1970-01-01 01:01:01,001"));
+ sb.Clear();
+ }
}
internal class FormatterOne : AbsoluteTimeDateFormatter