From 31bff45d1966effef55e0c0bb2fb6dfd9bf2981d Mon Sep 17 00:00:00 2001
From: joost <joost@cnoc.nl>
Date: Tue, 11 Apr 2017 09:39:35 +0000
Subject: [PATCH]  * Test for r35770

git-svn-id: trunk@35771 -
---
 packages/fppkg/tests/fullfpcinstallationtests.pas | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/packages/fppkg/tests/fullfpcinstallationtests.pas b/packages/fppkg/tests/fullfpcinstallationtests.pas
index bc434463ab..034a55d20c 100644
--- a/packages/fppkg/tests/fullfpcinstallationtests.pas
+++ b/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.