mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-03 04:38:32 +02:00
+ add tests for default namespaces
git-svn-id: trunk@38921 -
This commit is contained in:
parent
7e1a058bb2
commit
79aab18b13
16
.gitattributes
vendored
16
.gitattributes
vendored
@ -12266,6 +12266,7 @@ tests/test/cpu16/i8086/tsegofs1a.pp svneol=native#text/plain
|
||||
tests/test/cpu16/i8086/ttasm1.pp svneol=native#text/plain
|
||||
tests/test/cpu16/i8086/ttheap1.pp svneol=native#text/pascal
|
||||
tests/test/cpu16/taddint1.pp svneol=native#text/pascal
|
||||
tests/test/dots/unit6.pp svneol=native#text/pascal
|
||||
tests/test/dumpclass.pp svneol=native#text/plain
|
||||
tests/test/dumpmethods.pp svneol=native#text/plain
|
||||
tests/test/jvm/JavaClass.java svneol=native#text/plain
|
||||
@ -13727,6 +13728,10 @@ tests/test/tudots.dot.prog.pp svneol=native#text/pascal
|
||||
tests/test/tudots.pp svneol=native#text/pascal
|
||||
tests/test/tudots.prog.pp svneol=native#text/pascal
|
||||
tests/test/tudots.test.pp svneol=native#text/pascal
|
||||
tests/test/tudots2.pp svneol=native#text/pascal
|
||||
tests/test/tudots3.pp svneol=native#text/pascal
|
||||
tests/test/tudots4.pp svneol=native#text/pascal
|
||||
tests/test/tudots5.pp svneol=native#text/pascal
|
||||
tests/test/tuglylabels1.pp svneol=native#text/plain
|
||||
tests/test/tunaligned1.pp svneol=native#text/plain
|
||||
tests/test/tunistr1.pp svneol=native#text/plain
|
||||
@ -13772,6 +13777,16 @@ tests/test/tx64ccnv.pp svneol=native#text/plain
|
||||
tests/test/uabstrcl.pp svneol=native#text/plain
|
||||
tests/test/uchlp12.pp svneol=native#text/pascal
|
||||
tests/test/uchlp18.pp svneol=native#text/pascal
|
||||
tests/test/udots.moredots.unit7.pp svneol=native#text/pascal
|
||||
tests/test/udots.moredots.unit8.pp svneol=native#text/pascal
|
||||
tests/test/udots.udots.unit4.pp svneol=native#text/pascal
|
||||
tests/test/udots.udots.unit5.pp svneol=native#text/pascal
|
||||
tests/test/udots.unit1.pp svneol=native#text/pascal
|
||||
tests/test/udots.unit2.pp svneol=native#text/pascal
|
||||
tests/test/udots.unit3.pp svneol=native#text/pascal
|
||||
tests/test/udots.unit4.pp svneol=native#text/pascal
|
||||
tests/test/udots.unit6.pp svneol=native#text/pascal
|
||||
tests/test/udots.unit8.pp svneol=native#text/pascal
|
||||
tests/test/uenum2a.pp svneol=native#text/plain
|
||||
tests/test/uenum2b.pp svneol=native#text/plain
|
||||
tests/test/ugenconstraints.pas svneol=native#text/pascal
|
||||
@ -13812,6 +13827,7 @@ tests/test/ulib2a.pp svneol=native#text/plain
|
||||
tests/test/umaclocalprocparam3f.pp svneol=native#text/plain
|
||||
tests/test/umacpas1.pp svneol=native#text/plain
|
||||
tests/test/umainnam.pp svneol=native#text/plain
|
||||
tests/test/unit3.pp svneol=native#text/pascal
|
||||
tests/test/units/character/tgetnumericvalue.pp svneol=native#text/pascal
|
||||
tests/test/units/character/tgetnumericvalue2.pp svneol=native#text/pascal
|
||||
tests/test/units/character/tgetnumericvalue3.pp svneol=native#text/pascal
|
||||
|
13
tests/test/dots/unit6.pp
Normal file
13
tests/test/dots/unit6.pp
Normal file
@ -0,0 +1,13 @@
|
||||
{ this unit belongs to the udots tests }
|
||||
|
||||
unit Unit6;
|
||||
|
||||
interface
|
||||
|
||||
const
|
||||
Unit6Str = 'Unit6';
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
|
69
tests/test/tudots2.pp
Normal file
69
tests/test/tudots2.pp
Normal file
@ -0,0 +1,69 @@
|
||||
{ %OPT=-FNudots -FNudots.moredots -Un }
|
||||
|
||||
{$UnitPath ./dots}
|
||||
|
||||
program tudots2;
|
||||
|
||||
uses
|
||||
unit1, // picks up UDots.Unit1 in udots.unit1.pp
|
||||
unit2, // picks up Alpha.Beta in udots.unit2.pp
|
||||
unit3, // picks up Unit3 in unit3.pp (instead of also existing udots.unit3.pp)
|
||||
unit4, // picks up UDots.Unit4 in udots.unit4.pp (instead of also existing udots.udots.unit4.pp)
|
||||
udots.unit5, // picks up UDots.UDots.Unit5 in udots.udots.unit5.pp
|
||||
unit6, // picks up Unit6 in udots/unit6.pp (instead of also existing udots.unit6.pp)
|
||||
unit7, // picks up UDots.MoreDots.Unit7 in udots.moredots.unit7.pp
|
||||
unit8; // picks up UDots.Unit8 in udots.unit8.pp (instead of also existing udots.moredots.unit8.pp)
|
||||
|
||||
begin
|
||||
if Unit1Str <> 'UDots.Unit1' then
|
||||
Halt(1);
|
||||
if Unit2Str <> 'Alpha.Beta' then
|
||||
Halt(2);
|
||||
if Unit3Str <> 'Unit3' then
|
||||
Halt(3);
|
||||
if Unit4Str <> 'UDots.Unit4' then
|
||||
Halt(4);
|
||||
if Unit5Str <> 'UDots.UDots.Unit5' then
|
||||
Halt(5);
|
||||
if Unit6Str <> 'Unit6' then
|
||||
Halt(6);
|
||||
if Unit7Str <> 'UDots.MoreDots.Unit7' then
|
||||
Halt(7);
|
||||
if Unit8Str <> 'UDots.Unit8' then
|
||||
Halt(8);
|
||||
|
||||
{ check whether the sub symbols are available as well }
|
||||
if unit1.Unit1Str <> 'UDots.Unit1' then
|
||||
Halt(20);
|
||||
if udots.unit1.Unit1Str <> 'UDots.Unit1' then
|
||||
Halt(21);
|
||||
if unit2.Unit2Str <> 'Alpha.Beta' then
|
||||
Halt(22);
|
||||
if udots.unit2.Unit2Str <> 'Alpha.Beta' then
|
||||
Halt(23);
|
||||
if unit3.Unit3Str <> 'Unit3' then
|
||||
Halt(24);
|
||||
if unit4.Unit4Str <> 'UDots.Unit4' then
|
||||
Halt(25);
|
||||
if udots.unit4.Unit4Str <> 'UDots.Unit4' then
|
||||
Halt(26);
|
||||
{ Note: unit5.Unit5Str would be illegal }
|
||||
if udots.unit5.Unit5Str <> 'UDots.UDots.Unit5' then
|
||||
Halt(27);
|
||||
if udots.udots.unit5.Unit5Str <> 'UDots.UDots.Unit5' then
|
||||
Halt(28);
|
||||
if unit6.Unit6Str <> 'Unit6' then
|
||||
Halt(29);
|
||||
if unit7.Unit7Str <> 'UDots.MoreDots.Unit7' then
|
||||
Halt(30);
|
||||
if moredots.unit7.Unit7Str <> 'UDots.MoreDots.Unit7' then
|
||||
Halt(31);
|
||||
if udots.moredots.unit7.Unit7Str <> 'UDots.MoreDots.Unit7' then
|
||||
Halt(32);
|
||||
if unit8.Unit8Str <> 'UDots.Unit8' then
|
||||
Halt(33);
|
||||
if udots.unit8.Unit8Str <> 'UDots.Unit8' then
|
||||
Halt(34);
|
||||
|
||||
Writeln('ok');
|
||||
end.
|
13
tests/test/tudots3.pp
Normal file
13
tests/test/tudots3.pp
Normal file
@ -0,0 +1,13 @@
|
||||
{ %FAIL }
|
||||
{ %OPT=-FNudots }
|
||||
|
||||
program tudots3;
|
||||
|
||||
uses
|
||||
{ both reference the same unit }
|
||||
Unit1,
|
||||
UDots.Unit1;
|
||||
|
||||
begin
|
||||
end.
|
||||
|
13
tests/test/tudots4.pp
Normal file
13
tests/test/tudots4.pp
Normal file
@ -0,0 +1,13 @@
|
||||
{ %FAIL }
|
||||
{ %OPT=-FNudots }
|
||||
|
||||
program tudots4;
|
||||
|
||||
uses
|
||||
{ both reference the same unit }
|
||||
UDots.Unit1,
|
||||
Unit1;
|
||||
|
||||
begin
|
||||
end.
|
||||
|
19
tests/test/tudots5.pp
Normal file
19
tests/test/tudots5.pp
Normal file
@ -0,0 +1,19 @@
|
||||
{ %OPT=-FNudots.moredots -FNudots }
|
||||
|
||||
program tudots5;
|
||||
|
||||
uses
|
||||
unit8; // picks up UDots.MoreDots.Unit8 in udots.moredots.unit8.pp (instead of also existing udots.unit8.pp)
|
||||
|
||||
begin
|
||||
if Unit8Str <> 'UDots.MoreDots.Unit8' then
|
||||
Halt(1);
|
||||
if Unit8.Unit8Str <> 'UDots.MoreDots.Unit8' then
|
||||
Halt(2);
|
||||
if MoreDots.Unit8.Unit8Str <> 'UDots.MoreDots.Unit8' then
|
||||
Halt(3);
|
||||
if UDots.MoreDots.Unit8.Unit8Str <> 'UDots.MoreDots.Unit8' then
|
||||
Halt(4);
|
||||
|
||||
Writeln('ok');
|
||||
end.
|
11
tests/test/udots.moredots.unit7.pp
Normal file
11
tests/test/udots.moredots.unit7.pp
Normal file
@ -0,0 +1,11 @@
|
||||
unit UDots.MoreDots.Unit7;
|
||||
|
||||
interface
|
||||
|
||||
const
|
||||
Unit7Str = 'UDots.MoreDots.Unit7';
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
|
11
tests/test/udots.moredots.unit8.pp
Normal file
11
tests/test/udots.moredots.unit8.pp
Normal file
@ -0,0 +1,11 @@
|
||||
unit UDots.MoreDots.Unit8;
|
||||
|
||||
interface
|
||||
|
||||
const
|
||||
Unit8Str = 'UDots.MoreDots.Unit8';
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
|
11
tests/test/udots.udots.unit4.pp
Normal file
11
tests/test/udots.udots.unit4.pp
Normal file
@ -0,0 +1,11 @@
|
||||
unit UDots.UDots.Unit4;
|
||||
|
||||
interface
|
||||
|
||||
const
|
||||
Unit4Str = 'UDots.UDots.Unit4';
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
|
11
tests/test/udots.udots.unit5.pp
Normal file
11
tests/test/udots.udots.unit5.pp
Normal file
@ -0,0 +1,11 @@
|
||||
unit UDots.UDots.Unit5;
|
||||
|
||||
interface
|
||||
|
||||
const
|
||||
Unit5Str = 'UDots.UDots.Unit5';
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
|
11
tests/test/udots.unit1.pp
Normal file
11
tests/test/udots.unit1.pp
Normal file
@ -0,0 +1,11 @@
|
||||
unit UDots.Unit1;
|
||||
|
||||
interface
|
||||
|
||||
const
|
||||
Unit1Str = 'UDots.Unit1';
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
|
11
tests/test/udots.unit2.pp
Normal file
11
tests/test/udots.unit2.pp
Normal file
@ -0,0 +1,11 @@
|
||||
unit Alpha.Beta;
|
||||
|
||||
interface
|
||||
|
||||
const
|
||||
Unit2Str = 'Alpha.Beta';
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
|
11
tests/test/udots.unit3.pp
Normal file
11
tests/test/udots.unit3.pp
Normal file
@ -0,0 +1,11 @@
|
||||
unit UDots.Unit3;
|
||||
|
||||
interface
|
||||
|
||||
const
|
||||
Unit3Str = 'UDots.Unit3';
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
|
11
tests/test/udots.unit4.pp
Normal file
11
tests/test/udots.unit4.pp
Normal file
@ -0,0 +1,11 @@
|
||||
unit UDots.Unit4;
|
||||
|
||||
interface
|
||||
|
||||
const
|
||||
Unit4Str = 'UDots.Unit4';
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
|
11
tests/test/udots.unit6.pp
Normal file
11
tests/test/udots.unit6.pp
Normal file
@ -0,0 +1,11 @@
|
||||
unit UDots.Unit6;
|
||||
|
||||
interface
|
||||
|
||||
const
|
||||
Unit6Str = 'UDots.Unit6';
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
|
11
tests/test/udots.unit8.pp
Normal file
11
tests/test/udots.unit8.pp
Normal file
@ -0,0 +1,11 @@
|
||||
unit UDots.Unit8;
|
||||
|
||||
interface
|
||||
|
||||
const
|
||||
Unit8Str = 'UDots.Unit8';
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
|
13
tests/test/unit3.pp
Normal file
13
tests/test/unit3.pp
Normal file
@ -0,0 +1,13 @@
|
||||
{ this unit belongs to the udots tests }
|
||||
|
||||
unit Unit3;
|
||||
|
||||
interface
|
||||
|
||||
const
|
||||
Unit3Str = 'Unit3';
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user