[fpc-pascal] TMaskUtils.ValidateInput function: how is it supposed to behave?

Luiz Americo Pereira Camara luizamericop at gmail.com
Sun May 8 18:38:46 CEST 2016


2016-04-18 15:26 GMT-03:00 Luiz Americo Pereira Camara <
luizamericop at gmail.com>:

>
> I propose to write a test suite first with the desired output, based on
> Delphi.
>
>
I created a test suite that can be compiled with Delphi (dunit) and fpc
(fpcunit).

Attached are 3 projects: Delphi, fpc (tests MaskUtils function), lazarus
(tests LCL.EditMask function)

Compiled with Delphi 7 - all tests passes
FPC 3.0 - maskutils 7 failures 1 error
LCL trunk - 3 failures

There are some oddities in the Delphi 7 results (some of them are marked
with //?? comment). I can't say if is a bug or the expected behavior.

Examples:
Res := FormatMaskText('00', 'test');
Returns 'te'. 00 is not supposed to be only numbers?

 Res := FormatMaskText('\!cc;0', 'test');
Returns 'te!st'. Should not be '!test' ?

Anyway i suggest to run the tests with a newer Delphi before settling the
expected behavior


The projects are hosted at
https://bitbucket.org/blikblum/pascal-demos/src/c248883d46797e9b3760338367a0786198acbc47/delphi/FormatMaskText/?at=master

https://bitbucket.org/blikblum/pascal-demos/src/c248883d46797e9b3760338367a0786198acbc47/fpc/FormatMaskTextTests/?at=master

https://bitbucket.org/blikblum/pascal-demos/src/c248883d46797e9b3760338367a0786198acbc47/lazarus/FormatMaskTextLCLTests/?at=master

Luiz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160508/dba9c577/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: formatmasktests.zip
Type: application/zip
Size: 9338 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160508/dba9c577/attachment.zip>


More information about the fpc-pascal mailing list