aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2020-04-27 18:27:24 +0200
committerStefan Kangas2020-04-27 18:27:24 +0200
commit1be8485d67ef36b1d50496008be47be3050cc1bd (patch)
treeab7c6aa990b6c1af84ef158a1c1053e136d25b83
parent08408b13faa911b586ac0c181159ada452a942cc (diff)
downloademacs-1be8485d67ef36b1d50496008be47be3050cc1bd.tar.gz
emacs-1be8485d67ef36b1d50496008be47be3050cc1bd.zip
Use lexical-binding in calendar tests
* test/lisp/calendar/icalendar-tests.el: * test/lisp/calendar/parse-time-tests.el: Use lexical-binding. * test/lisp/calendar/icalendar-tests.el (icalendar--format-ical-event) (icalendar--decode-isodatetime, icalendar-tests--do-test-import) (icalendar-tests--decode-isodatetime): Silence byte-compiler.
-rw-r--r--test/lisp/calendar/icalendar-tests.el13
-rw-r--r--test/lisp/calendar/parse-time-tests.el2
2 files changed, 7 insertions, 8 deletions
diff --git a/test/lisp/calendar/icalendar-tests.el b/test/lisp/calendar/icalendar-tests.el
index 986255250dc..d496878205b 100644
--- a/test/lisp/calendar/icalendar-tests.el
+++ b/test/lisp/calendar/icalendar-tests.el
@@ -1,4 +1,4 @@
1;; icalendar-tests.el --- Test suite for icalendar.el 1;; icalendar-tests.el --- Test suite for icalendar.el -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2005, 2008-2020 Free Software Foundation, Inc. 3;; Copyright (C) 2005, 2008-2020 Free Software Foundation, Inc.
4 4
@@ -419,11 +419,11 @@ END:VEVENT
419"))) 419")))
420 (should (string= "SUM sum DES des LOC loc ORG org" 420 (should (string= "SUM sum DES des LOC loc ORG org"
421 (icalendar--format-ical-event event))) 421 (icalendar--format-ical-event event)))
422 (setq icalendar-import-format (lambda (&rest ignore) 422 (setq icalendar-import-format (lambda (&rest _ignore)
423 "helloworld")) 423 "helloworld"))
424 (should (string= "helloworld" (icalendar--format-ical-event event))) 424 (should (string= "helloworld" (icalendar--format-ical-event event)))
425 (setq icalendar-import-format 425 (setq icalendar-import-format
426 (lambda (e) 426 (lambda (event)
427 (format "-%s-%s-%s-%s-%s-%s-%s-" 427 (format "-%s-%s-%s-%s-%s-%s-%s-"
428 (icalendar--get-event-property event 'SUMMARY) 428 (icalendar--get-event-property event 'SUMMARY)
429 (icalendar--get-event-property event 'DESCRIPTION) 429 (icalendar--get-event-property event 'DESCRIPTION)
@@ -465,8 +465,7 @@ END:VEVENT
465 465
466(ert-deftest icalendar--decode-isodatetime () 466(ert-deftest icalendar--decode-isodatetime ()
467 "Test `icalendar--decode-isodatetime'." 467 "Test `icalendar--decode-isodatetime'."
468 (let ((tz (getenv "TZ")) 468 (let ((tz (getenv "TZ")))
469 result)
470 (unwind-protect 469 (unwind-protect
471 (progn 470 (progn
472 ;; Use Eastern European Time (UTC+2, UTC+3 daylight saving) 471 ;; Use Eastern European Time (UTC+2, UTC+3 daylight saving)
@@ -886,7 +885,7 @@ During import test the timezone is set to Central European Time."
886 (icalendar-tests--do-test-import input expected-american))))) 885 (icalendar-tests--do-test-import input expected-american)))))
887 (setenv "TZ" timezone)))) 886 (setenv "TZ" timezone))))
888 887
889(defun icalendar-tests--do-test-import (input expected-output) 888(defun icalendar-tests--do-test-import (_input expected-output)
890 "Actually perform import test. 889 "Actually perform import test.
891Argument INPUT input icalendar string. 890Argument INPUT input icalendar string.
892Argument EXPECTED-OUTPUT expected diary string." 891Argument EXPECTED-OUTPUT expected diary string."
@@ -2347,7 +2346,7 @@ END:VCALENDAR
2347 (let ((time (icalendar--decode-isodatetime string day zone))) 2346 (let ((time (icalendar--decode-isodatetime string day zone)))
2348 (format-time-string "%FT%T%z" (encode-time time) 0))) 2347 (format-time-string "%FT%T%z" (encode-time time) 0)))
2349 2348
2350(defun icalendar-tests--decode-isodatetime (ical-string) 2349(defun icalendar-tests--decode-isodatetime (_ical-string)
2351 (should (equal (icalendar-test--format "20040917T050910-0200") 2350 (should (equal (icalendar-test--format "20040917T050910-0200")
2352 "2004-09-17T03:09:10+0000")) 2351 "2004-09-17T03:09:10+0000"))
2353 (should (equal (icalendar-test--format "20040917T050910") 2352 (should (equal (icalendar-test--format "20040917T050910")
diff --git a/test/lisp/calendar/parse-time-tests.el b/test/lisp/calendar/parse-time-tests.el
index 4924e8b072a..e1801a57307 100644
--- a/test/lisp/calendar/parse-time-tests.el
+++ b/test/lisp/calendar/parse-time-tests.el
@@ -1,4 +1,4 @@
1;; parse-time-tests.el --- Test suite for parse-time.el 1;; parse-time-tests.el --- Test suite for parse-time.el -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2016-2020 Free Software Foundation, Inc. 3;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
4 4