From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: thunk2@arcor.de (Thomas Plass) Newsgroups: gmane.emacs.bugs Subject: bug#34315: [PATCH] icalendar.el: DURATION fix + more robust timezone handling Date: Thu, 1 Oct 2020 21:49:06 +0300 Message-ID: <24438.9378.994810.275603@AGAME7.local> References: <23640.9851.562972.730234@AGAME7.local> <875ztog7hx.fsf@panama> <87wom1otsw.fsf@panama> <87zh7267sy.fsf@gnus.org> <87pn7yo54t.fsf@panama> <83o8ni4fhu.fsf@gnu.org> <24369.32256.954408.774614@AGAME7.local> <87y2mlxx8r.fsf@gnus.org> <87d03x43kz.fsf@panama> <24371.59842.984273.402129@AGAME7.local> <87y2mkknyc.fsf@gnus.org> <24371.61149.995030.284670@AGAME7.local> <87364rq4yl.fsf@panama> <87imcwf404.fsf@panama> <24400.43911.666145.400179@AGAME7.local> <874kof2aui.fsf@panama> <24435.1743.473339.944597@AGAME7.local> <874knewwfc.fsf@gnus.org> <24437.56299.111042.412318@AGAME7.local> <87d021vrzi.fsf@panama> <877ds9rk4j.fsf@gnus.org> <878scpvqcf.fsf@panama> Reply-To: Thomas Plass Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34608"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , Thomas Plass , Jan Tatarik , 34315@debbugs.gnu.org To: Ulf Jasper Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 01 20:50:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kO3ec-0008sy-5k for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 01 Oct 2020 20:50:10 +0200 Original-Received: from localhost ([::1]:48320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kO3eb-00057v-8D for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 01 Oct 2020 14:50:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kO3eU-00057J-Fv for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2020 14:50:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55004) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kO3eU-0006ZJ-0x for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2020 14:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kO3eT-000206-Ve for bug-gnu-emacs@gnu.org; Thu, 01 Oct 2020 14:50:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: thunk2@arcor.de (Thomas Plass) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Oct 2020 18:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34315 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 34315-submit@debbugs.gnu.org id=B34315.16015781747652 (code B ref 34315); Thu, 01 Oct 2020 18:50:01 +0000 Original-Received: (at 34315) by debbugs.gnu.org; 1 Oct 2020 18:49:34 +0000 Original-Received: from localhost ([127.0.0.1]:38317 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kO3e2-0001zL-Cb for submit@debbugs.gnu.org; Thu, 01 Oct 2020 14:49:34 -0400 Original-Received: from vsmx012.vodafonemail.xion.oxcs.net ([153.92.174.90]:50874) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kO3dz-0001z7-7L for 34315@debbugs.gnu.org; Thu, 01 Oct 2020 14:49:33 -0400 Original-Received: from vsmx004.vodafonemail.xion.oxcs.net (unknown [192.168.75.198]) by mta-8-out.mta.xion.oxcs.net (Postfix) with ESMTP id 254BAF3534F; Thu, 1 Oct 2020 18:49:25 +0000 (UTC) Original-Received: from agame7.arcor.de (unknown [2.200.173.137]) by mta-8-out.mta.xion.oxcs.net (Postfix) with ESMTPA id 67AC419AE5F; Thu, 1 Oct 2020 18:49:12 +0000 (UTC) In-Reply-To: Your message of Thursday, October 1 2020 18:54:56 (ID: <878scpvqcf.fsf@panama>). X-VADE-STATUS: LEGIT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:189560 Archived-At: I'd like to get some guidance from people involved on the following proposal: Ulf Jasper wrote at 18:54 on October 1, 2020: : Currently there is no way to use ics files in icalendar-tests. Would it be acceptable to: - create a directory root/test/lisp/calendar/icalendar-resources - extend icalendar-tests.el with the following: (defvar icalendar-resources-directory "icalendar-resources" "Name of directory containing ICS files. This directory is relative to icalendar-tests.el.") (defun icalendar-tests--get-ical-from-file (ics-file &optional component) "Return iCalendar data structures from ICS-FILE. Optional symbol COMPONENT names a top-level component like 'VTIMEZONE." (let (ical) (if (file-exists-p ics-file) (save-excursion (with-temp-buffer (insert-file-contents ics-file) (goto-char (point-min)) (setq ical (car (icalendar--read-element nil nil))) (if component (setq res (car (icalendar--get-children ical component))) (setq res ical)))) (error "Can't find ICS file %s" ics-file)))) Which could be used thusly in the definition of 'icalendar--parse-vtimezone: (ert-deftest icalendar--parse-vtimezone () "Test method for `icalendar--parse-vtimezone'." (let (vtimezone result) (setq vtimezone (icalendar-tests--get-ical-from-file (concat (file-name-as-directory icalendar-resources-directory) "Asia_Shanghai_20200916T070000_in-calendar_VTIMEZONE_tzurl_org.ics") 'VTIMEZONE)) (setq result (icalendar--parse-vtimezone vtimezone)) (should (string= "Asia/Shanghai" (car result))) (message (cdr result)) (should (string= "STD-08:00" (cdr result))) ... )) I have no idea how the test code is run, in particular how (concat (file-name-as-directory icalendar-resources-directory) "Asia_Shanghai_20200916T070000_in-calendar_VTIMEZONE_tzurl_org.ics") could be made to resolve. Also, I cannot alter the git. Please advise.