Browse Source

+ added test based on bug #24504

git-svn-id: trunk@34850 -
Tomas Hajny 8 years ago
parent
commit
ff02b2dfb5
2 changed files with 31 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 30 0
      tests/test/units/dos/tfsrch2.pp

+ 1 - 0
.gitattributes

@@ -13224,6 +13224,7 @@ tests/test/units/dos/tenv.pp svneol=native#text/plain
 tests/test/units/dos/tfattr.pp svneol=native#text/plain
 tests/test/units/dos/tfexpand.pp svneol=native#text/plain
 tests/test/units/dos/tfsearch.pp svneol=native#text/plain
+tests/test/units/dos/tfsrch2.pp svneol=native#text/plain
 tests/test/units/dos/tidos.pp svneol=native#text/plain
 tests/test/units/dos/tidos2.pp svneol=native#text/plain
 tests/test/units/dos/tverify.pp svneol=native#text/plain

+ 30 - 0
tests/test/units/dos/tfsrch2.pp

@@ -0,0 +1,30 @@
+program TFSrch2;
+
+uses
+  Dos;
+
+procedure TestWildCard(ADirList: String); //Issue #0024504
+var
+  FRes: PathStr;
+const
+  Expected = '';
+begin
+{$IFDEF DEBUG}
+  write('Testing FSearch(''',ADirList, ''', ''', DirectorySeparator, '''): ');
+{$ENDIF DEBUG}
+  FRes := FSearch(ADirList, DirectorySeparator);
+  if (FRes <> Expected) then
+  begin
+    writeln('Fail: expected ''',Expected,''', but got ''',FRes,'''.');
+    Halt(1);
+  end
+{$IFDEF DEBUG}
+  else
+    writeln('OK.');
+{$ENDIF DEBUG}
+end;
+
+begin
+  TestWildCard(AllFilesMask);
+  TestWildCard('?');
+end.