* Tests for NAMESPACES directive

This commit is contained in:
Michaël Van Canneyt 2023-07-26 09:45:01 +02:00 committed by Pierre Muller
parent 3b5fded2b3
commit 07fce04893
7 changed files with 90 additions and 0 deletions

15
tests/test/nt.a.pp Normal file
View File

@ -0,0 +1,15 @@
unit nt.a;
interface
Function GetIt : String;
implementation
Function GetIt : String;
begin
getit:='a1';
end;
end.

15
tests/test/nt.nst.pp Normal file
View File

@ -0,0 +1,15 @@
unit nt.nst;
interface
Procedure HelloThere;
implementation
Procedure HelloThere;
begin
Writeln('Hello, there');
end;
end.

15
tests/test/nt2.a.pp Normal file
View File

@ -0,0 +1,15 @@
unit nt2.a;
interface
Function GetIt : String;
implementation
Function GetIt : String;
begin
getit:='a2';
end;
end.

15
tests/test/nt2.nst2.pp Normal file
View File

@ -0,0 +1,15 @@
unit nt2.nst2;
interface
Procedure HelloThereToo;
implementation
Procedure HelloThereToo;
begin
Writeln('Hello, there too!');
end;
end.

7
tests/test/tnamesp.pp Normal file
View File

@ -0,0 +1,7 @@
{$NAMESPACES nt}
uses nst;
begin
hellothere;
end.

8
tests/test/tnamesp2.pp Normal file
View File

@ -0,0 +1,8 @@
{$NAMESPACES nt2,nt}
uses nst,nst2;
begin
hellothere;
hellothereToo;
end.

15
tests/test/tnamesp3.pp Normal file
View File

@ -0,0 +1,15 @@
// searched from last to first !
{$NAMESPACES nt2,nt}
uses a;
var
which : string;
begin
which:=GetIt;
if (which<>'a1') then
begin
Writeln('Wrong namespace used, expected a1, but got: ',which);
Halt(1);
end;
end.