use of nl.knaw.huygens.timbuctoo.model.Datable in project timbuctoo by HuygensING.
the class DatableTest method convertYear_range_q2.
@Test
public void convertYear_range_q2() {
Assert.assertTrue(EdtfPattern.YEAR_RANGE_Q2.matches("20??"));
Assert.assertFalse(EdtfPattern.YEAR_RANGE_Q2.matches("2010"));
Assert.assertFalse(EdtfPattern.YEAR_RANGE_Q2.matches("20??-02-13"));
testDatable("2000-01-01:12", "2099-12-31:12", Datable.Certainty.LOW, new Datable("20??"));
}
use of nl.knaw.huygens.timbuctoo.model.Datable in project timbuctoo by HuygensING.
the class DatableTest method convertYear_month_day_hq.
@Test
public void convertYear_month_day_hq() {
String edtf = "1648-05-15?";
Assert.assertTrue(EdtfPattern.YEAR_MONTH_DAY_HQ.matches(edtf));
testDatable("1648-05-15:12", "1648-05-15:12", Datable.Certainty.LOW, new Datable(edtf));
}
use of nl.knaw.huygens.timbuctoo.model.Datable in project timbuctoo by HuygensING.
the class DatableTest method convertYear_month.
@Test
public void convertYear_month() {
Assert.assertTrue(EdtfPattern.YEAR_MONTH.matches("2001-01"));
Assert.assertFalse(EdtfPattern.YEAR_MONTH.matches("2010"));
Assert.assertFalse(EdtfPattern.YEAR_MONTH.matches("2???-02-13"));
testDatable("2010-02-01:12", "2010-02-28:12", Datable.Certainty.HIGH, new Datable("2010-02"));
testDatable("1610-12-01:12", "1610-12-31:12", Datable.Certainty.HIGH, new Datable("1610-12"));
}
use of nl.knaw.huygens.timbuctoo.model.Datable in project timbuctoo by HuygensING.
the class DatableTest method testCompareToEqualSameEdtf.
@Test
public void testCompareToEqualSameEdtf() {
Datable first = new Datable("20131011");
Datable second = new Datable("20131011");
assertEquals(0, first.compareTo(second));
}
use of nl.knaw.huygens.timbuctoo.model.Datable in project timbuctoo by HuygensING.
the class DatableTest method testGetLowerLimitNoFromDateSpecified.
@Test
public void testGetLowerLimitNoFromDateSpecified() {
Datable rangeWithoutFromDate = new Datable("open/2013");
assertThat(rangeWithoutFromDate.getLowerLimit(), is(nullValue()));
}
Aggregations