mihaibudiu commented on code in PR #3600:
URL: https://github.com/apache/calcite/pull/3600#discussion_r1436579820


##########
core/src/test/java/org/apache/calcite/util/format/FormatElementEnumTest.java:
##########
@@ -33,4 +33,130 @@ class FormatElementEnumTest {
     FormatElementEnum.DAY.format(ts, 
Date.from(Instant.parse("2014-09-30T10:00:00Z")));
     assertThat(ts, hasToString("Tuesday"));
   }
+
+  @Test void testD() {
+    StringBuilder ts = new StringBuilder();
+    FormatElementEnum.D.format(ts, 
Date.from(Instant.parse("2014-09-30T10:00:00Z")));

Review Comment:
   Since the date is the same for all tests maybe you can factor it out in a 
separate helper function.
   This would also enable extending this testing code for other dates.
   



##########
core/src/test/java/org/apache/calcite/util/format/FormatElementEnumTest.java:
##########
@@ -33,4 +33,130 @@ class FormatElementEnumTest {
     FormatElementEnum.DAY.format(ts, 
Date.from(Instant.parse("2014-09-30T10:00:00Z")));
     assertThat(ts, hasToString("Tuesday"));
   }
+
+  @Test void testD() {
+    StringBuilder ts = new StringBuilder();
+    FormatElementEnum.D.format(ts, 
Date.from(Instant.parse("2014-09-30T10:00:00Z")));
+    assertThat(ts, hasToString("3"));
+  }
+
+  @Test void testDD() {
+    StringBuilder ts = new StringBuilder();
+    FormatElementEnum.DD.format(ts, 
Date.from(Instant.parse("2014-09-30T10:00:00Z")));
+    assertThat(ts, hasToString("30"));
+  }
+
+  @Test void testDDD() {
+    StringBuilder ts = new StringBuilder();
+    FormatElementEnum.DDD.format(ts, 
Date.from(Instant.parse("2014-09-30T10:00:00Z")));
+    assertThat(ts, hasToString("273"));
+  }
+
+  @Test void testDY() {
+    StringBuilder ts = new StringBuilder();
+    FormatElementEnum.DY.format(ts, 
Date.from(Instant.parse("2014-09-30T10:00:00Z")));
+    assertThat(ts, hasToString("Tue"));
+  }
+
+  @Test void testFF1() {
+    StringBuilder ts = new StringBuilder();
+    FormatElementEnum.FF1.format(ts, 
Date.from(Instant.parse("2014-09-30T10:00:00Z")));
+    assertThat(ts, hasToString("0"));
+  }
+
+  @Test void testFF2() {

Review Comment:
   if these are microseconds perhaps you can use a datetime with microseconds?
   Does Java support microseconds in Date?



-- 
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]

Reply via email to