summaryrefslogtreecommitdiff
path: root/packages/pastojs/tests
diff options
context:
space:
mode:
authormattias <mattias@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-11-20 16:11:18 +0000
committermattias <mattias@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-11-20 16:11:18 +0000
commit39ccf0c4e75d11fcf68067b8001af93c278af21f (patch)
tree195d188ad59a2550731ac88fc12135015249a50f /packages/pastojs/tests
parent9001752c1c820d53c5d112caa9d7a4a82dc9edba (diff)
downloadfpc-39ccf0c4e75d11fcf68067b8001af93c278af21f.tar.gz
pastojs: fixed search include file mode objfpc in dir of current include file
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@47493 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/pastojs/tests')
-rw-r--r--packages/pastojs/tests/tcmodules.pas2
-rw-r--r--packages/pastojs/tests/tcunitsearch.pas52
2 files changed, 53 insertions, 1 deletions
diff --git a/packages/pastojs/tests/tcmodules.pas b/packages/pastojs/tests/tcmodules.pas
index 6d020e6d3e..124d64ba44 100644
--- a/packages/pastojs/tests/tcmodules.pas
+++ b/packages/pastojs/tests/tcmodules.pas
@@ -233,7 +233,7 @@ type
Published
Procedure TestReservedWords;
- // program/units
+ // program, units, includes
Procedure TestEmptyProgram;
Procedure TestEmptyProgramUseStrict;
Procedure TestEmptyUnit;
diff --git a/packages/pastojs/tests/tcunitsearch.pas b/packages/pastojs/tests/tcunitsearch.pas
index 3c8945e2e0..4cc0c52d7f 100644
--- a/packages/pastojs/tests/tcunitsearch.pas
+++ b/packages/pastojs/tests/tcunitsearch.pas
@@ -143,7 +143,11 @@ type
procedure TestUS_Program_FU;
procedure TestUS_Program_FU_o;
procedure TestUS_Program_FE_o;
+
+ // include files
procedure TestUS_IncludeSameDir;
+ Procedure TestUS_Include_NestedDelphi;
+ Procedure TestUS_Include_NestedObjFPC;
// uses 'in' modifier
procedure TestUS_UsesInFile;
@@ -728,6 +732,54 @@ begin
Compile(['test1.pas','-Fusub','-FElib','-ofoo.js']);
end;
+procedure TTestCLI_UnitSearch.TestUS_Include_NestedDelphi;
+begin
+ AddUnit('system.pp',[''],['']);
+ AddFile('sub/inc1.inc',[
+ 'type number = longint;',
+ '{$I sub/deep/inc2.inc}',
+ '']);
+ AddFile('sub/deep/inc2.inc',[
+ 'type numero = number;',
+ '{$I sub/inc3.inc}',
+ '']);
+ AddFile('sub/inc3.inc',[
+ 'type nummer = numero;',
+ '']);
+ AddFile('test1.pas',[
+ '{$mode delphi}',
+ '{$i sub/inc1.inc}',
+ 'var',
+ ' n: nummer;',
+ 'begin',
+ 'end.']);
+ Compile(['test1.pas','-Jc']);
+end;
+
+procedure TTestCLI_UnitSearch.TestUS_Include_NestedObjFPC;
+begin
+ AddUnit('system.pp',[''],['']);
+ AddFile('sub/inc1.inc',[
+ 'type number = longint;',
+ '{$I deep/inc2.inc}',
+ '']);
+ AddFile('sub/deep/inc2.inc',[
+ 'type numero = number;',
+ '{$I ../inc3.inc}',
+ '']);
+ AddFile('sub/inc3.inc',[
+ 'type nummer = numero;',
+ '']);
+ AddFile('test1.pas',[
+ '{$mode objfpc}',
+ '{$i sub/inc1.inc}',
+ 'var',
+ ' n: nummer;',
+ 'begin',
+ 'end.']);
+ Compile(['test1.pas','-Jc']);
+end;
+
procedure TTestCLI_UnitSearch.TestUS_UsesInFile;
begin
AddUnit('system.pp',[''],['']);