We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 87f5475 commit 41ae861Copy full SHA for 41ae861
1 file changed
ccu-historian-test/src/mdz/ccuhistorian/DatabaseTest.groovy
@@ -8,7 +8,23 @@ class DatabaseTest {
8
9
@Test
10
public void testFormatTimestamp() {
11
- // TODO:
12
- fail("Not yet implemented")
+ def tests=[
+ ["2025-12-28", "2025-52", "2025"],
13
+ ["2025-12-29", "2026-01", "2025"],
14
+ ["2025-12-30", "2026-01", "2025"],
15
+ ["2025-12-31", "2026-01", "2025"],
16
+ ["2026-01-01", "2026-01", "2026"],
17
+
18
+ ["2026-12-27", "2026-52", "2026"],
19
+ ["2026-12-28", "2026-53", "2026"],
20
+ ["2027-01-03", "2026-53", "2027"],
21
+ ["2027-01-04", "2027-01", "2027"],
22
+ ]
23
+ tests.each {
24
+ def (ds, yw, y)=it
25
+ def d=Date.parse("yyyy-MM-dd", ds)
26
+ assertEquals(yw, Database.formatTimestamp("%X-%W", d))
27
+ assertEquals(y, Database.formatTimestamp("%Y", d))
28
+ }
29
}
30
0 commit comments