elharo commented on code in PR #1227:
URL: https://github.com/apache/commons-lang/pull/1227#discussion_r1716753131
##########
src/test/java/org/apache/commons/lang3/time/DurationFormatUtilsTest.java:
##########
@@ -473,6 +473,21 @@ public void testFormatPeriod() {
assertEquals("helloworld", DurationFormatUtils.formatPeriod(time1970,
time, "'hello''world'"));
}
+ @Test
+ public void testSingleQuotes() {
+ final Calendar cal1970 = Calendar.getInstance();
+ cal1970.set(1970, Calendar.JANUARY, 1, 0, 0, 0);
+ cal1970.set(Calendar.MILLISECOND, 0);
+ final long time1970 = cal1970.getTime().getTime();
+ long time = time1970 + 60 * 1000;
+ // empty quoted strings: '' should now generate a single quote
Review Comment:
OK, now I see why I was confused. Two single quotes is **not** or no longer
is an empty quoted string. This is an escape sequence for a single quote.
Rewrite comment to clarify.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]