8
votes
Vote UpVote

Delphi: Use TStrings to parse non-standard separated strings, and validate it with DUnit tests

The Wiert Corner – Recently, I was at a client where in a project strings had to be split from: ‘FI-150 1U; FI-049-I L=20 MM;LET OP LASVORM’ Into: ‘FI-150 1U’ ‘FI-049-I L=20 MM’ ‘LET OP LASVORM’ At first sight, this looks simple: Semicolon Separated Values and you are done. Not so fast Mr Smart Alec: watch the optional spaces! The best thing for problems like these is to start with an empty implementation that some units tests covering it. I use DUnit for Delphi unit testing. Unit testing should go with code coverage, but there are few Delphi code coverage ...
Favorite? Off-Topic? jpluimers @ 2010-09-08 06:00

Statistics

Visits: 1006
Votes: 8
Favorites: 1
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Alister Christie
Charles Ardour
Frederic
GregB
Ph. B.
Ravaut123
vcldeveloper
Zzzzz
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)