diff --git a/arrow/locales.py b/arrow/locales.py index 757df480d..b567d095f 100644 --- a/arrow/locales.py +++ b/arrow/locales.py @@ -6173,11 +6173,11 @@ def describe( day_abbreviations = [ "", "සදුද", + "අ", "බදා", - "බදා", + "බ්‍රහ", "සිකු", "සෙන", - "අ", "ඉරිදා", ] diff --git a/tests/test_locales.py b/tests/test_locales.py index 3d7120e36..a07adeae5 100644 --- a/tests/test_locales.py +++ b/tests/test_locales.py @@ -2951,7 +2951,26 @@ def test_format_relative_past(self): def test_weekday(self): dt = arrow.Arrow(2015, 4, 11, 17, 30, 00) assert self.locale.day_name(dt.isoweekday()) == "සෙනසුරාදා" - assert self.locale.day_abbreviation(dt.isoweekday()) == "අ" + assert self.locale.day_abbreviation(dt.isoweekday()) == "සෙන" + + def test_day_abbreviations(self): + # Each abbreviation must label the day it belongs to. Tuesday through + # Saturday used to be shifted by one, so Tuesday and Wednesday shared + # "බදා" and Thursday had no abbreviation of its own. + assert self.locale.day_abbreviation(1) == "සදුද" + assert self.locale.day_abbreviation(2) == "අ" + assert self.locale.day_abbreviation(3) == "බදා" + assert self.locale.day_abbreviation(4) == "බ්‍රහ" + assert self.locale.day_abbreviation(5) == "සිකු" + assert self.locale.day_abbreviation(6) == "සෙන" + assert self.locale.day_abbreviation(7) == "ඉරිදා" + + for day in range(1, 8): + assert self.locale.day_name(day).startswith( + self.locale.day_abbreviation(day) + ) + + assert len(set(self.locale.day_abbreviations[1:])) == 7 @pytest.mark.usefixtures("lang_locale")