Browse Source

* Test for r35770

git-svn-id: trunk@35771 -
joost 8 years ago
parent
commit
31bff45d19
1 changed files with 14 additions and 0 deletions
  1. 14 0
      packages/fppkg/tests/fullfpcinstallationtests.pas

+ 14 - 0
packages/fppkg/tests/fullfpcinstallationtests.pas

@@ -28,6 +28,7 @@ type
     procedure TestListPackages;
     procedure IntTestListPackages;
     procedure TestPackageA;
+    procedure TestLooseFPMFile;
   end;
 
   { TFullFPCInstallationSetup }
@@ -339,6 +340,19 @@ begin
   CheckFalse(FileExists(ConcatPaths([TFullFPCInstallationSetup.GetCurrentTestPath,'user','lib','fpc', TFullFPCInstallationSetup.GetCompilerVersion, 'fpmkinst',TFullFPCInstallationSetup.GetTargetString,'PackageA.fpm'])), 'PackageAUnitA.fpm found after uninstall');
 end;
 
+procedure TFullFPCInstallationTests.TestLooseFPMFile;
+var
+  F: Text;
+  s: string;
+begin
+  System.Assign(F, ConcatPaths([TFullFPCInstallationSetup.GetCurrentTestPath, 'lib', 'fpc', TFullFPCInstallationSetup.GetCompilerVersion, 'fpmkinst', TFullFPCInstallationSetup.GetTargetString,'empty.fpm']));
+  System.Rewrite(F);
+  System.Close(F);
+
+  s := RunFppkgIndir(TFullFPCInstallationSetup.GetCurrentTestPath, ['list'], 'list packages');
+  Check(pos('Failed to load package "empty"', s) > 0, 'Missing warning that the invalid package is skipped')
+end;
+
 Initialization
   RegisterTestDecorator(TFullFPCInstallationSetup, TFullFPCInstallationTests);
 end.