X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/68a9dbf11abd9f30877e7ceda480a795fdebe1c8..a1858883733a454b6ffb73aa263ef5badc2a1d07:/testreadtxt2.dpr diff --git a/testreadtxt2.dpr b/testreadtxt2.dpr new file mode 100644 index 0000000..a378293 --- /dev/null +++ b/testreadtxt2.dpr @@ -0,0 +1,36 @@ +{ Copyright (C) 2009 Bas Steendijk and Peter Green + For conditions of distribution and use, see copyright notice in zlib_license.txt + which is included in the package + ----------------------------------------------------------------------------- } + + +program testreadtxt2; +uses readtxt2, classes; + +var + t: treadtxt; + f: file; +procedure writestring(var f: file; s : string); +begin + blockwrite(f,s[1],length(s)); +end; + +begin + assignfile(f,'mixed.txt'); + rewrite(f,1); + writestring(f,'DOS'#13#10); + writestring(f,'UNIX'#10); + writestring(f,'MAC'#13); + writestring(f,'NONE'); + closefile(f); + t := treadtxt.createf('mixed.txt'); + if t.readline = 'DOS' then writeln('DOS success') else writeln('DOS fail'); + if t.readline = 'UNIX' then writeln('UNIX success') else writeln('UNIX fail'); + if t.readline = 'MAC' then writeln('MAC success') else writeln('MAC fail'); + if t.readline = 'NONE' then writeln('NONE success') else writeln('NONE fail'); + t.destroy; + {$ifdef win32} + //make things a little easier to test in the delphi GUI + readln; + {$endif} +end.