From 79aab18b134f75a4d0cc9f304cc0003a50bb88a2 Mon Sep 17 00:00:00 2001 From: svenbarth Date: Sat, 5 May 2018 17:21:31 +0000 Subject: [PATCH] + add tests for default namespaces git-svn-id: trunk@38921 - --- .gitattributes | 16 +++++++ tests/test/dots/unit6.pp | 13 ++++++ tests/test/tudots2.pp | 69 ++++++++++++++++++++++++++++++ tests/test/tudots3.pp | 13 ++++++ tests/test/tudots4.pp | 13 ++++++ tests/test/tudots5.pp | 19 ++++++++ tests/test/udots.moredots.unit7.pp | 11 +++++ tests/test/udots.moredots.unit8.pp | 11 +++++ tests/test/udots.udots.unit4.pp | 11 +++++ tests/test/udots.udots.unit5.pp | 11 +++++ tests/test/udots.unit1.pp | 11 +++++ tests/test/udots.unit2.pp | 11 +++++ tests/test/udots.unit3.pp | 11 +++++ tests/test/udots.unit4.pp | 11 +++++ tests/test/udots.unit6.pp | 11 +++++ tests/test/udots.unit8.pp | 11 +++++ tests/test/unit3.pp | 13 ++++++ 17 files changed, 266 insertions(+) create mode 100644 tests/test/dots/unit6.pp create mode 100644 tests/test/tudots2.pp create mode 100644 tests/test/tudots3.pp create mode 100644 tests/test/tudots4.pp create mode 100644 tests/test/tudots5.pp create mode 100644 tests/test/udots.moredots.unit7.pp create mode 100644 tests/test/udots.moredots.unit8.pp create mode 100644 tests/test/udots.udots.unit4.pp create mode 100644 tests/test/udots.udots.unit5.pp create mode 100644 tests/test/udots.unit1.pp create mode 100644 tests/test/udots.unit2.pp create mode 100644 tests/test/udots.unit3.pp create mode 100644 tests/test/udots.unit4.pp create mode 100644 tests/test/udots.unit6.pp create mode 100644 tests/test/udots.unit8.pp create mode 100644 tests/test/unit3.pp diff --git a/.gitattributes b/.gitattributes index d99f64265d..acaa626121 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/tests/test/dots/unit6.pp b/tests/test/dots/unit6.pp new file mode 100644 index 0000000000..06b45bc9f2 --- /dev/null +++ b/tests/test/dots/unit6.pp @@ -0,0 +1,13 @@ +{ this unit belongs to the udots tests } + +unit Unit6; + +interface + +const + Unit6Str = 'Unit6'; + +implementation + +end. + diff --git a/tests/test/tudots2.pp b/tests/test/tudots2.pp new file mode 100644 index 0000000000..b0db18ff98 --- /dev/null +++ b/tests/test/tudots2.pp @@ -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. diff --git a/tests/test/tudots3.pp b/tests/test/tudots3.pp new file mode 100644 index 0000000000..ad04a65456 --- /dev/null +++ b/tests/test/tudots3.pp @@ -0,0 +1,13 @@ +{ %FAIL } +{ %OPT=-FNudots } + +program tudots3; + +uses + { both reference the same unit } + Unit1, + UDots.Unit1; + +begin +end. + diff --git a/tests/test/tudots4.pp b/tests/test/tudots4.pp new file mode 100644 index 0000000000..cc9be64938 --- /dev/null +++ b/tests/test/tudots4.pp @@ -0,0 +1,13 @@ +{ %FAIL } +{ %OPT=-FNudots } + +program tudots4; + +uses + { both reference the same unit } + UDots.Unit1, + Unit1; + +begin +end. + diff --git a/tests/test/tudots5.pp b/tests/test/tudots5.pp new file mode 100644 index 0000000000..3faf360826 --- /dev/null +++ b/tests/test/tudots5.pp @@ -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. diff --git a/tests/test/udots.moredots.unit7.pp b/tests/test/udots.moredots.unit7.pp new file mode 100644 index 0000000000..df2943868f --- /dev/null +++ b/tests/test/udots.moredots.unit7.pp @@ -0,0 +1,11 @@ +unit UDots.MoreDots.Unit7; + +interface + +const + Unit7Str = 'UDots.MoreDots.Unit7'; + +implementation + +end. + diff --git a/tests/test/udots.moredots.unit8.pp b/tests/test/udots.moredots.unit8.pp new file mode 100644 index 0000000000..3c0577fc73 --- /dev/null +++ b/tests/test/udots.moredots.unit8.pp @@ -0,0 +1,11 @@ +unit UDots.MoreDots.Unit8; + +interface + +const + Unit8Str = 'UDots.MoreDots.Unit8'; + +implementation + +end. + diff --git a/tests/test/udots.udots.unit4.pp b/tests/test/udots.udots.unit4.pp new file mode 100644 index 0000000000..10c3be86aa --- /dev/null +++ b/tests/test/udots.udots.unit4.pp @@ -0,0 +1,11 @@ +unit UDots.UDots.Unit4; + +interface + +const + Unit4Str = 'UDots.UDots.Unit4'; + +implementation + +end. + diff --git a/tests/test/udots.udots.unit5.pp b/tests/test/udots.udots.unit5.pp new file mode 100644 index 0000000000..bd4df4f774 --- /dev/null +++ b/tests/test/udots.udots.unit5.pp @@ -0,0 +1,11 @@ +unit UDots.UDots.Unit5; + +interface + +const + Unit5Str = 'UDots.UDots.Unit5'; + +implementation + +end. + diff --git a/tests/test/udots.unit1.pp b/tests/test/udots.unit1.pp new file mode 100644 index 0000000000..3209d360de --- /dev/null +++ b/tests/test/udots.unit1.pp @@ -0,0 +1,11 @@ +unit UDots.Unit1; + +interface + +const + Unit1Str = 'UDots.Unit1'; + +implementation + +end. + diff --git a/tests/test/udots.unit2.pp b/tests/test/udots.unit2.pp new file mode 100644 index 0000000000..f54b08eba7 --- /dev/null +++ b/tests/test/udots.unit2.pp @@ -0,0 +1,11 @@ +unit Alpha.Beta; + +interface + +const + Unit2Str = 'Alpha.Beta'; + +implementation + +end. + diff --git a/tests/test/udots.unit3.pp b/tests/test/udots.unit3.pp new file mode 100644 index 0000000000..add9e19982 --- /dev/null +++ b/tests/test/udots.unit3.pp @@ -0,0 +1,11 @@ +unit UDots.Unit3; + +interface + +const + Unit3Str = 'UDots.Unit3'; + +implementation + +end. + diff --git a/tests/test/udots.unit4.pp b/tests/test/udots.unit4.pp new file mode 100644 index 0000000000..d9f0c5f90a --- /dev/null +++ b/tests/test/udots.unit4.pp @@ -0,0 +1,11 @@ +unit UDots.Unit4; + +interface + +const + Unit4Str = 'UDots.Unit4'; + +implementation + +end. + diff --git a/tests/test/udots.unit6.pp b/tests/test/udots.unit6.pp new file mode 100644 index 0000000000..b222089c0c --- /dev/null +++ b/tests/test/udots.unit6.pp @@ -0,0 +1,11 @@ +unit UDots.Unit6; + +interface + +const + Unit6Str = 'UDots.Unit6'; + +implementation + +end. + diff --git a/tests/test/udots.unit8.pp b/tests/test/udots.unit8.pp new file mode 100644 index 0000000000..580bf72a51 --- /dev/null +++ b/tests/test/udots.unit8.pp @@ -0,0 +1,11 @@ +unit UDots.Unit8; + +interface + +const + Unit8Str = 'UDots.Unit8'; + +implementation + +end. + diff --git a/tests/test/unit3.pp b/tests/test/unit3.pp new file mode 100644 index 0000000000..0917c8a9eb --- /dev/null +++ b/tests/test/unit3.pp @@ -0,0 +1,13 @@ +{ this unit belongs to the udots tests } + +unit Unit3; + +interface + +const + Unit3Str = 'Unit3'; + +implementation + +end. +