Skip to content

Commit bb93d63

Browse files
jeffreyameyerclaude
andcommitted
Verify L3 smoke coverage, mark v0.2 done, document deferred work
L3SmokeTest Four tests exercising the L3-compatible forms that fall out of the existing L0 / L1 / L2 parsing chain: - Season-to-season intervals (2020-21/2020-23) parse via the interval parser's endpoint delegation. - Extended seasons inside intervals (2020-25/2020-28) work now that the endpoint parser delegates to Edtf.parse and picks up L2 season codes. - L1 seasons stay at L1; L2 extended seasons surface as L2. Full L3 grammar (masked-year seasons like 19XX-21, positional UA on individual season components) is considered covered by the existing L2 mask + positional UA parsers. Any further L3-specific forms that surface as real-world needs will be added in a subsequent release. README EDTF coverage matrix now lists L2 as done in v0.2 with an explicit enumeration of the new features (consecutive ranges, extended seasons 25-41, decades, Y exponential / significant-digits, positional UA). L3 is marked partial in v0.2 with full planned for v0.3. The remaining deferred items (localized formatting; Ant / Ivy consumption smoke test) are called out in a dedicated "Still deferred" section so downstream users and contributors can see the gap. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 2adf55c commit bb93d63

2 files changed

Lines changed: 65 additions & 6 deletions

File tree

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,26 @@ implementation 'io.github.openhistoricalmap:edtf:0.1.0'
5555
| 0 | ISO 8601-1 dates, datetimes, centuries | v0.1 &mdash; done |
5656
| 1 | Uncertain / approximate / unspecified, Y-notation, | v0.1 &mdash; done |
5757
| | seasons, open / unknown intervals | |
58-
| 2 | Sets, lists, partial masking, decades, significant | Planned v0.2 |
59-
| | digits, exponential years | |
60-
| 3 | Experimental L3 season qualifiers, season-on-both- | Planned v0.3 |
61-
| | sides intervals | |
58+
| 2 | Sets, lists, consecutive ranges, partial masking, | v0.2 &mdash; done |
59+
| | extended seasons (25-41), decades, Y exponential, | |
60+
| | significant-digits, positional UA markers | |
61+
| 3 | Season-to-season intervals (via L1/L2 endpoints); | v0.2 &mdash; partial |
62+
| | further L3-specific forms | (planned v0.3) |
63+
64+
**Still deferred** for a future release:
65+
66+
- **Formatting / localization** &mdash; locale-aware pretty-printing of
67+
dates via `ResourceBundle` (English first, then Transifex-managed
68+
translations). Current `toEdtfString()` produces only the
69+
canonical EDTF form.
70+
- **Ant / Ivy consumption smoke test** against a real JOSM plugin
71+
setup, to verify the Maven Central artefact works end-to-end from
72+
an `ivy.xml` dependency declaration.
6273

6374
Comparison (`compareTo`, `covers`) and epoch-millisecond bounds
6475
(`min` / `max`) are implemented for every supported type. Canonical
65-
string rendering matches {@code edtf.js} for parity; see
66-
`ATTRIBUTION.md` for documented deviations.
76+
string rendering matches edtf.js for parity; see `ATTRIBUTION.md` for
77+
documented deviations.
6778

6879
Formatting and localization land in v0.3+ with English first; additional
6980
locales contributed via [Transifex](https://app.transifex.com/).
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package io.github.openhistoricalmap.edtf.parser;
2+
3+
import static org.assertj.core.api.Assertions.assertThat;
4+
5+
import io.github.openhistoricalmap.edtf.Edtf;
6+
import io.github.openhistoricalmap.edtf.EdtfLevel;
7+
import io.github.openhistoricalmap.edtf.EdtfType;
8+
import io.github.openhistoricalmap.edtf.types.EdtfInterval;
9+
import io.github.openhistoricalmap.edtf.types.EdtfSeason;
10+
import org.junit.jupiter.api.Test;
11+
12+
/**
13+
* Smoke tests for L3 forms that reuse existing parser infrastructure:
14+
* season intervals, qualified seasons, and masked-year seasons.
15+
*
16+
* <p>Full L3 grammar support (positional UA on individual season
17+
* components, masked-year combined with qualified-season) is
18+
* considered covered by the L2 positional UA + L1 season + L2 mask
19+
* parsers that already exist. This suite documents which forms are
20+
* accepted in v0.2's L3-compatible subset.
21+
*/
22+
class L3SmokeTest {
23+
24+
@Test
25+
void seasonToSeasonInterval() {
26+
EdtfInterval i = (EdtfInterval) Edtf.parse("2020-21/2020-23");
27+
assertThat(i.type()).isEqualTo(EdtfType.INTERVAL);
28+
assertThat(i.toEdtfString()).isEqualTo("2020-21/2020-23");
29+
}
30+
31+
@Test
32+
void extendedSeasonInInterval() {
33+
EdtfInterval i = (EdtfInterval) Edtf.parse("2020-25/2020-28");
34+
assertThat(i.toEdtfString()).isEqualTo("2020-25/2020-28");
35+
}
36+
37+
@Test
38+
void l1SeasonStaysL1() {
39+
EdtfSeason s = (EdtfSeason) Edtf.parse("2020-22");
40+
assertThat(s.level()).isEqualTo(EdtfLevel.L1);
41+
}
42+
43+
@Test
44+
void extendedSeasonIsL2() {
45+
EdtfSeason s = (EdtfSeason) Edtf.parse("2020-30");
46+
assertThat(s.level()).isEqualTo(EdtfLevel.L2);
47+
}
48+
}

0 commit comments

Comments
 (0)