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

Michael Van Canneyt michael at freepascal.org
Mon Apr 18 21:06:03 CEST 2016



On Mon, 18 Apr 2016, Luiz Americo Pereira Camara wrote:

> 2016-04-18 13:47 GMT-03:00 Bart <bartjunk64 at gmail.com>:
>
> [..]
>
>> The internal processing of the (edit)mask is the same as TMaskEdit.
>> If that is broken somehow, it is also broken in TMaskEdit.
>>
>> The only functions that may need adjustments are
>>
>> * function FormatMaskText(const EditMask: string; const AValue: string):
>> string;
>> * function FormatMaskInput(const EditMask: string): string;
>> * function MaskDoFormatText(const EditMask: string; const AValue: string;
>>                    ASpaceChar: Char): string;
>> * function TMaskUtils.TryValidateInput(out ValidatedString: String):
>> Boolean;
>>
>> But since there is no real documentation and there is no test suite,
>> it's hard to tell if they do not function as they should or introduce
>> regressions.
>>
>>
> I propose to write a test suite first with the desired output, based on
> Delphi.

I agree 100%

>
> Given that the implementation becomes a detail, subject to changes in
> future.
>
> I can take the duty of starting, just need to know the format. fpcunit or
> plain tests like most fpc tests?

fpcunit. 'most fpc tests' are for the compiler, not for unit functionality.

Michael.



More information about the fpc-pascal mailing list