zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: zsh workers <zsh-workers@zsh.org>
Subject: Re: PATCH: Make ztrftime pass more things to strftime
Date: Thu, 9 Jul 2015 07:16:33 +0200	[thread overview]
Message-ID: <CAHYJk3RtTe-Mo=OPi4z31Y=WW0kocYmYXNpQ1x8k=pnjZu889w@mail.gmail.com> (raw)
In-Reply-To: <20150708115312.4c81944e@pwslap01u.europe.root.pri>

On Wed, 8 Jul 2015 01:15:00 +0200
Mikael Magnusson <mikachu@gmail.com> 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
<p.stephenson@samsung.com> wrote:
> On Wed, 8 Jul 2015 01:21:42 +0200
> Mikael-san <mikachu@gmail.com> wrote:
haha
>> Hey look, it actually works too,
>>
>> % print -P %D\{%x\}
>> 2015年07月08日
>> % print -P %D\{%Ex\}
>> 平成27年07月08日
>
> 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=C
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).

-- 
Mikael Magnusson


  reply	other threads:[~2015-07-09  5:16 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-07 23:15 Mikael Magnusson
2015-07-07 23:21 ` Mikael Magnusson
2015-07-08 10:53   ` Peter Stephenson
2015-07-09  5:16     ` Mikael Magnusson [this message]
2015-07-09  8:41       ` Peter Stephenson
2015-07-09  9:58         ` PATCH: ztrftime: Pass everything unhandled to the system strftime() Mikael Magnusson
2015-07-09 10:17           ` Peter Stephenson
2015-07-10 13:37             ` Peter Stephenson
2015-07-10 16:18               ` Skipping tests (was Re: PATCH: ztrftime: Pass everything ...) Bart Schaefer
2015-07-10 16:23                 ` Peter Stephenson
2015-07-10 18:31               ` PATCH: ztrftime: Pass everything unhandled to the system strftime() Daniel Shahaf
2015-07-10 23:54                 ` ZTST_skip (was Re: PATCH: ztrftime ...) Bart Schaefer
2015-07-09 15:52           ` PATCH: ztrftime: Pass everything unhandled to the system strftime() Jun T.
2015-07-10 14:53           ` Jun T.
2015-07-10 18:23             ` Mikael Magnusson
2015-07-27 11:56           ` Jun T.
2015-07-27 13:31             ` Mikael Magnusson
2015-07-27 16:50               ` Jun T.
2015-07-27 17:01               ` Jun T.
2015-09-01 13:53           ` Oliver Kiddle
2015-09-01 14:07             ` Peter Stephenson
2015-09-01 21:16             ` PATCH: Avoid gcc case syntax Mikael Magnusson
2015-07-08 14:03   ` PATCH: Make ztrftime pass more things to strftime Jun T.
2015-07-09  4:36     ` Mikael Magnusson
2015-07-08 10:39 ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHYJk3RtTe-Mo=OPi4z31Y=WW0kocYmYXNpQ1x8k=pnjZu889w@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).