From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4246 invoked by alias); 9 Jul 2015 05:16:41 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35741 Received: (qmail 19526 invoked from network); 9 Jul 2015 05:16:39 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=RcMz0L+DT1qGXjBxPdhvnpJxewdIqcGCyAGa/5pRfTc=; b=UY3x4UowC6X70YpEj+1978ZrSaX1EC3O86ZDBl3qfC/E0xAEuXcYXEh/mvUr6ZjmU7 xRg1m8Q77drz6VrClHelrbaqGhhqSdcdykTsiTJX+cRiB3DFTPifMsw02msJTmD2aTLz LoBKerVbUT8aA6h61xJUobEJeEjqV8lXsdF9ezdO94le8wkc5oFVgn+nAuEHolK+Cf/f imNb0M6lXwEVxH10iVRSslvlNVo+Wlh0F4yfCu4omHHp1UvdcStDmDKfeAz/1JjgEZbI Arf3jyLABcOsfDI0v+NmcNy0XT+UU6cE6XZrw4FP1aRxH3uV003vrc8D16YbMh9slKnL u+wg== MIME-Version: 1.0 X-Received: by 10.107.136.89 with SMTP id k86mr23709686iod.53.1436418994034; Wed, 08 Jul 2015 22:16:34 -0700 (PDT) In-Reply-To: <20150708115312.4c81944e@pwslap01u.europe.root.pri> References: <1436310900-9519-1-git-send-email-mikachu@gmail.com> <20150708115312.4c81944e@pwslap01u.europe.root.pri> Date: Thu, 9 Jul 2015 07:16:33 +0200 Message-ID: Subject: Re: PATCH: Make ztrftime pass more things to strftime From: Mikael Magnusson To: Peter Stephenson Cc: zsh workers Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, 8 Jul 2015 01:15:00 +0200 Mikael Magnusson wrote: > I poked at this for an hour, and this is the first version that passes > make check and doesn't segfault randomly, so it is not very well tested, > to say the least. Opinions on the approach? "Not totally doomed" (I haven't done a character-by-character survey of the goings on). Implementing on top of an interface like this is a real pain, since you can't help re-implementing chunks and scratching your head about how to pass the info you've got out back in again. But it's worth doing now internationalisation / internationalization / Internationalisierung / ... is considered basic. It probably mostly needs a few tests. print -P %D{...} will do most of what you want. On Wed, Jul 8, 2015 at 12:53 PM, Peter Stephenson wrote: > On Wed, 8 Jul 2015 01:21:42 +0200 > Mikael-san wrote: haha >> Hey look, it actually works too, >> >> % print -P %D\{%x\} >> 2015=E5=B9=B407=E6=9C=8808=E6=97=A5 >> % print -P %D\{%Ex\} >> =E5=B9=B3=E6=88=9027=E5=B9=B407=E6=9C=8808=E6=97=A5 > > By the way, that's also worth testing explicitly, but it should probably > go with the multibyte tests together with an extra test for availability > of the locale in question to avoid false test failures. > > pws Okay, I got as far as LC_ALL=3DC 0:ztrftime extensions And I'm not sure how to test anything. If the libc doesn't implement the gnu extensions, then it will either fail or we could just skip the test. I suppose if we don't skip, then we'll get plenty of reports of test failures. But if we always skip if it detects no gnu extensions, it won't ever really fail either. Unless our basic %y printing suddenly breaks I suppose. Can you skip an individual test, or do I need to make a new module? Same goes for the multibyte test, I don't want to skip the whole module if there's no japanese locale, I think. Maybe these can all go in a new module then? And only test things if we find gnu extensions and a japanese utf8 locale. We can only test the non-extension padding if it's the 1-9th of a month, the second happens to be under 10, etc. I'm not sure what else to test than the output being a number. The existing print -P %w%W%D test already exercises some of the code (It ends up calling ztrftime with strings like "%a %f" or so). --=20 Mikael Magnusson