--- /dev/null
+{ Copyright (C) 2009 Bas Steendijk and Peter Green\r
+ For conditions of distribution and use, see copyright notice in zlib_license.txt\r
+ which is included in the package\r
+ ----------------------------------------------------------------------------- }\r
+\r
+\r
+program testreadtxt2;\r
+uses readtxt2, classes;\r
+\r
+var\r
+ t: treadtxt;\r
+ f: file;\r
+procedure writestring(var f: file; s : string);\r
+begin\r
+ blockwrite(f,s[1],length(s));\r
+end;\r
+\r
+begin\r
+ assignfile(f,'mixed.txt');\r
+ rewrite(f,1);\r
+ writestring(f,'DOS'#13#10);\r
+ writestring(f,'UNIX'#10);\r
+ writestring(f,'MAC'#13);\r
+ writestring(f,'NONE');\r
+ closefile(f);\r
+ t := treadtxt.createf('mixed.txt');\r
+ if t.readline = 'DOS' then writeln('DOS success') else writeln('DOS fail');\r
+ if t.readline = 'UNIX' then writeln('UNIX success') else writeln('UNIX fail');\r
+ if t.readline = 'MAC' then writeln('MAC success') else writeln('MAC fail');\r
+ if t.readline = 'NONE' then writeln('NONE success') else writeln('NONE fail');\r
+ t.destroy;\r
+ {$ifdef win32}\r
+ //make things a little easier to test in the delphi GUI\r
+ readln;\r
+ {$endif}\r
+end.\r