freebsd fixups
[lcore.git] / testreadtxt2.dpr
1 {$apptype console}\r
2 \r
3 { Copyright (C) 2009 Bas Steendijk and Peter Green\r
4   For conditions of distribution and use, see copyright notice in zlib_license.txt\r
5   which is included in the package\r
6   ----------------------------------------------------------------------------- }\r
7 \r
8 \r
9 program testreadtxt2;\r
10 uses readtxt2, classes;\r
11 \r
12 var\r
13   t: treadtxt;\r
14   f: file;\r
15 procedure writestring(var f: file; s : string);\r
16 begin\r
17   blockwrite(f,s[1],length(s));\r
18 end;\r
19 \r
20 begin\r
21   assignfile(f,'mixed.txt');\r
22   rewrite(f,1);\r
23   writestring(f,'DOS'#13#10);\r
24   writestring(f,'UNIX'#10);\r
25   writestring(f,'MAC'#13);\r
26   writestring(f,'NONE');\r
27   closefile(f);\r
28   t := treadtxt.createf('mixed.txt');\r
29   if t.readline = 'DOS' then writeln('DOS success') else writeln('DOS fail');\r
30   if t.readline = 'UNIX' then writeln('UNIX success') else writeln('UNIX fail');\r
31   if t.readline = 'MAC' then writeln('MAC success') else writeln('MAC fail');\r
32   if t.readline = 'NONE' then writeln('NONE success') else writeln('NONE fail');\r
33   t.destroy;\r
34   {$ifdef win32}\r
35     //make things a little easier to test in the delphi GUI\r
36     readln;\r
37   {$endif}\r
38 end.\r