1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-06-10 01:06:04 +02:00

fix tests using zsh/datetime that I broke

This commit is contained in:
Peter Stephenson 2011-08-11 19:32:50 +00:00
parent 773737e09f
commit 548c4562fe
3 changed files with 29 additions and 4 deletions

View File

@ -1,5 +1,8 @@
2011-08-11 Peter Stephenson <p.w.stephenson@ntlworld.com>
* Src/params.c: unposted: Src/params.c, Test/V04features.ztst:
fix some tests I broke.
* Src/subst.c: 29674: Src/Modules/datetime.c,
Doc/Zsh/mod_datetime.yo: add $epochtime array.
@ -15229,5 +15232,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
* $Revision: 1.5419 $
* $Revision: 1.5420 $
*****************************************************

View File

@ -3046,9 +3046,21 @@ mod_export void
stdunsetfn(Param pm, UNUSED(int exp))
{
switch (PM_TYPE(pm->node.flags)) {
case PM_SCALAR: pm->gsu.s->setfn(pm, NULL); break;
case PM_ARRAY: pm->gsu.a->setfn(pm, NULL); break;
case PM_HASHED: pm->gsu.h->setfn(pm, NULL); break;
case PM_SCALAR:
if (pm->gsu.s->setfn)
pm->gsu.s->setfn(pm, NULL);
break;
case PM_ARRAY:
if (pm->gsu.a->setfn)
pm->gsu.a->setfn(pm, NULL);
break;
case PM_HASHED:
if (pm->gsu.h->setfn)
pm->gsu.h->setfn(pm, NULL);
break;
default:
if (!(pm->node.flags & PM_SPECIAL))
pm->u.str = NULL;

View File

@ -17,18 +17,24 @@
0:Loading modules with no features
>-b:strftime
>-p:EPOCHSECONDS
>-p:EPOCHREALTIME
>-p:epochtime
zmodload -F zsh/datetime b:strftime
zmodload -lF zsh/datetime
0:Enabling features
>+b:strftime
>-p:EPOCHSECONDS
>-p:EPOCHREALTIME
>-p:epochtime
zmodload -F zsh/datetime +p:EPOCHSECONDS -b:strftime
zmodload -lF zsh/datetime
0:Disabling features
>-b:strftime
>+p:EPOCHSECONDS
>-p:EPOCHREALTIME
>-p:epochtime
zmodload -Fe zsh/datetime p:EPOCHSECONDS b:strftime
0:Testing existing features
@ -109,6 +115,8 @@
0:Feature state with loading after error enabling
>+b:strftime
>-p:EPOCHSECONDS
>+p:EPOCHREALTIME
>+p:epochtime
zmodload -F zsh/datetime p:EPOCHSECONDS
zmodload -Fe zsh/datetime +p:EPOCHSECONDS
@ -159,3 +167,5 @@
0:zmodload with no -F enables all features
>+b:strftime
>+p:EPOCHSECONDS
>+p:EPOCHREALTIME
>+p:epochtime