Mercurial > hg > octave-nkf
changeset 17839:2ff47214de72
datestr.m: Accomodate Mac OS X odd support of %p in strftime.
* scripts/time/datestr.m: For %!tests that have an AM/PM indicator,
use toupper on string before comparing to expected value since Mac OS X
does not return uppercase am/pm.
author | Rik <rik@octave.org> |
---|---|
date | Sat, 02 Nov 2013 22:18:02 -0700 |
parents | cfe5297e0f3b |
children | 18096cd30339 |
files | scripts/time/datestr.m |
diffstat | 1 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/time/datestr.m +++ b/scripts/time/datestr.m @@ -309,9 +309,15 @@ %!assert (datestr (testtime,11), "05") %!assert (datestr (testtime,12), "Dec05") %!assert (datestr (testtime,13), "02:33:17") -%!assert (datestr (testtime,14), " 2:33:17 AM") +## Mac OS X interprets %p parameter to strftime as lower case am/pm indicator. +## Accomodate this, although no other UNIX-based OS does this. +%!test +%! obs = toupper (datestr (testtime,14)); +%! assert (obs, " 2:33:17 AM"); %!assert (datestr (testtime,15), "02:33") -%!assert (datestr (testtime,16), " 2:33 AM") +%!test +%! obs = toupper (datestr (testtime,16)); +%! assert (obs, " 2:33 AM"); %!assert (datestr (testtime,17), "Q4-05") %!assert (datestr (testtime,18), "Q4") %!assert (datestr (testtime,19), "18/12")