Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2012-09

SDF/Delimitedtext: Request for *Delphi* test :)

5 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Reinier Olislagers

Hi list,

With regard to bug
19610 TStringList.delimitedtext doesn't respect quotechar I decided to expand the del4.zip test program in that report to a compiler test suite test program for stringlist.delimitedtext/sdf format. That will make it a lot easier to keep track of FPC's compliance with the sdf spec.

Assuming we want to be Delphi compatible, it would be nice to know what Delphi exactly produces though (because it differs a bit from what the Delphi help files say).
Please find attached the test program; it runs without errors on Turbo Delphi 2006 (I renamed the file to .dpr to easily compile it).

Due to bug 19610 (and perhaps more) it doesn't currently on FPC.

1. Could you please run this on other versions of Delphi and report back the results (presumably older versions will not run the test with commatext)
2. Additional tests welcome

As an aside, in bug 19610 I proposed writing out an sdf format that is always enclosed in quotes; this leads to unambiguous import of .delimitedtext.
To ensure this is feasible (i.e. Delphi can handle this), some tests in the program verify this.
E.g. my Turbo Delphi 2006 is returns the same data for strictdelimiter both true and false for these "safely quoted" strings, which is not the case for other sdf output.

Thanks,
Reinier

Reply by email

OBones
to Reinier Olislagers
Reinier Olislagers wrote
1. Could you please run this on other versions of Delphi and report back the results (presumably older versions will not run the test with commatext)

I have run it with D2007, DXE, DXE2 Win32 and DXE2 Win64, all gave the following result:

tw19610: sdf tests succeeded

For the first two there is a additional blank line in the output, right before the output line, but I don't think it is important.

Regards

Reply by email

Reinier Olislagers
to OBones
OBones wrote 14 lines
Reinier Olislagers wrote: > 1. Could you please run this on other versions of Delphi and report back > the results (presumably older versions will not run the test with > commatext) I have run it with D2007, DXE, DXE2 Win32 and DXE2 Win64, all gave the following result: tw19610: sdf tests succeeded For the first two there is a additional blank line in the output, right before the output line, but I don't think it is important. Regards

Thanks a lot!

Reply by email

Reinier Olislagers
to Reinier Olislagers
Reinier Olislagers wrote 10 lines
On 20-9-2012 13:15, OBones wrote: > Reinier Olislagers wrote: > >> 1. Could you please run this on other versions of Delphi and report back >> the results (presumably older versions will not run the test with >> commatext) > I have run it with D2007, DXE, DXE2 Win32 and DXE2 Win64, all gave the > following result: > > tw19610: sdf tests succeeded

Thanks, uploaded test program for inclusion in the FPC test suite in bug 19610.

Reply by email

Reinier Olislagers
to Reinier Olislagers
Reinier Olislagers wrote 14 lines
On 20-9-2012 13:34, Reinier Olislagers wrote: > On 20-9-2012 13:15, OBones wrote: >> Reinier Olislagers wrote: >> >>> 1. Could you please run this on other versions of Delphi and report back >>> the results (presumably older versions will not run the test with >>> commatext) >> I have run it with D2007, DXE, DXE2 Win32 and DXE2 Win64, all gave the >> following result: >> >> tw19610: sdf tests succeeded Thanks, uploaded test program for inclusion in the FPC test suite in bug 19610.

Just ran test program on Linux x64 before and after applying the patch in 19610.
Before: 5 test groups failed (all with StrictDelimiter:=true), including the test that write out strings to delimitedtext, reads them back in and compares them. In other words: saving strings to file and reading back can be unreliable.

After: all tests passed (and behaviour is the same as Delphi).

Also added draft text for
http://wiki.lazarus.freepascal.org/User_Changes_Trunk#Unit_changes

I think this patch is quite ready to be committed (patch, test suite test - confirmed with various Delphi versions, positive test results, change notice)... if Marco is too busy, perhaps somebody else could commit it?

That would certainly ease taazz' (and my) efforts on the forum to improve sdfdataset.

Thanks,
Reinier

Reply by email