mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 05:59:28 +02:00
+ Add traling separators tests
git-svn-id: trunk@18177 -
This commit is contained in:
parent
9d763ec052
commit
47b943d236
@ -7,6 +7,7 @@ uses
|
||||
|
||||
const
|
||||
HasErrors : boolean = false;
|
||||
AllowsTrailingSepartors: boolean = false;
|
||||
|
||||
procedure TestDirectoryExists(Const DirName : string; ExpectedResult : boolean);
|
||||
var
|
||||
@ -67,6 +68,10 @@ begin
|
||||
Writeln('Name="',N,'"');
|
||||
Writeln('Ext="',E,'"');
|
||||
TestDirectoryExists(P,true);
|
||||
if DirectoryExists(P+DirectorySeparator) and
|
||||
DirectoryExists(P+DirectorySeparator+DirectorySeparator) then
|
||||
AllowsTrailingSepartors:=true;
|
||||
|
||||
dir:=P;
|
||||
TestParents(dir);
|
||||
dir:=P+'_Dummy';
|
||||
@ -75,6 +80,12 @@ begin
|
||||
TestDirectoryExists(dir,false);
|
||||
mkdir(dir);
|
||||
TestDirectoryExists(dir,true);
|
||||
{ Check that using two directory separators fails }
|
||||
TestDirectoryExists(dir+DirectorySeparator,AllowsTrailingSepartors);
|
||||
TestDirectoryExists(dir+'/',AllowsTrailingSepartors);
|
||||
TestDirectoryExists(dir+'//',AllowsTrailingSepartors);
|
||||
if DirectorySeparator='\' then
|
||||
TestDirectoryExists(dir+'\\',AllowsTrailingSepartors);
|
||||
dir2:=dir+'_Dummy2';
|
||||
TestDirectoryExists(dir2,false);
|
||||
mkdir(dir2);
|
||||
|
Loading…
Reference in New Issue
Block a user