diff options
| author | Paul Eggert | 2019-10-05 21:23:15 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-10-05 21:24:09 -0700 |
| commit | 9d829b8be5b86668d5165b9d0c0cdc392b558dd3 (patch) | |
| tree | b2dc5d94b96bf540fdfde80a33f93bf4b4018e66 /test | |
| parent | aadf72167673c8702531ba3802e3d5f137f139ba (diff) | |
| download | emacs-9d829b8be5b86668d5165b9d0c0cdc392b558dd3.tar.gz emacs-9d829b8be5b86668d5165b9d0c0cdc392b558dd3.zip | |
Fix off-by-one bug in ISO 8601 BC years
* lisp/calendar/iso8601.el (iso8601--year-match)
(iso8601--full-date-match, iso8601--without-day-match)
(iso8601--week-date-match, iso8601--ordinal-date-match)
(iso8601-parse-date):
Don’t bother to separate the year’s sign from the year,
as that distinction is not needed: ISO 8601 uses
astronomical year numbering with a year zero, which
is what the Emacs time functions use, so there’s no
need to treat nonpositive years specially.
(iso8601--adjust-year): Remove; no longer needed
since callers can just use string-to-number.
* test/lisp/calendar/iso8601-tests.el (test-iso8601-date-years):
Adjust test case to match fixed behavior.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/calendar/iso8601-tests.el | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/lisp/calendar/iso8601-tests.el b/test/lisp/calendar/iso8601-tests.el index b5a3c9538d1..cc18d0702d8 100644 --- a/test/lisp/calendar/iso8601-tests.el +++ b/test/lisp/calendar/iso8601-tests.el | |||
| @@ -26,7 +26,7 @@ | |||
| 26 | (should (equal (iso8601-parse-date "1985") | 26 | (should (equal (iso8601-parse-date "1985") |
| 27 | '(nil nil nil nil nil 1985 nil nil nil))) | 27 | '(nil nil nil nil nil 1985 nil nil nil))) |
| 28 | (should (equal (iso8601-parse-date "-0003") | 28 | (should (equal (iso8601-parse-date "-0003") |
| 29 | '(nil nil nil nil nil -4 nil nil nil))) | 29 | '(nil nil nil nil nil -3 nil nil nil))) |
| 30 | (should (equal (iso8601-parse-date "+1985") | 30 | (should (equal (iso8601-parse-date "+1985") |
| 31 | '(nil nil nil nil nil 1985 nil nil nil)))) | 31 | '(nil nil nil nil nil 1985 nil nil nil)))) |
| 32 | 32 | ||