codetools: added tests for dotted units

git-svn-id: trunk@50120 -
This commit is contained in:
mattias 2015-10-19 13:23:15 +00:00
parent 5c15224a08
commit 1900575f1b
7 changed files with 104 additions and 0 deletions

6
.gitattributes vendored
View File

@ -1012,6 +1012,12 @@ components/codetools/tests/fpctests/tchlp52.pp svneol=native#text/plain
components/codetools/tests/fpctests/tchlp53.pp svneol=native#text/plain
components/codetools/tests/fpctests/tchlp6.pp svneol=native#text/plain
components/codetools/tests/fpctests/tchlp7.pp svneol=native#text/plain
components/codetools/tests/fpctests/tudots.dot.next.pp svneol=native#text/plain
components/codetools/tests/fpctests/tudots.dot.pp svneol=native#text/plain
components/codetools/tests/fpctests/tudots.dot.prog.pp svneol=native#text/plain
components/codetools/tests/fpctests/tudots.pp svneol=native#text/plain
components/codetools/tests/fpctests/tudots.prog.pp svneol=native#text/plain
components/codetools/tests/fpctests/tudots.test.pp svneol=native#text/plain
components/codetools/tests/fpctests/uchlp12.pp svneol=native#text/plain
components/codetools/tests/laztests/README.txt svneol=native#text/plain
components/codetools/tests/laztests/bug28861_unit1.pas svneol=native#text/plain

View File

@ -0,0 +1,14 @@
unit tudots.dot.next;
interface
type
ttest=byte;
var
test: integer;
implementation
end.

View File

@ -0,0 +1,26 @@
unit tudots.dot;
interface
var
test: char;
procedure t;
implementation
uses
tudots{ todo declaration:tudots}, tudots.dot.next{ todo declaration:tudots.dot.next};
// test that type is resolved
var
test1: tudots.dot.next.ttest{ todo declaration:tudots.dot.next.ttest};
procedure t;
begin
// test that we resolved the next identifier to the local variable test
tudots.dot.test{ todo declaration:tudots.dot.test} := 'c';
end;
end.

View File

@ -0,0 +1,15 @@
{%fail}
{%norun}
program tudots.dot.prog;
{$mode delphi}
uses
tudots{ todo declaration:tudots};
begin
// this must fail because we have a namespace tudots.dot and it has no unit test
tudots.dot.test{ todo } := 1;
end.

View File

@ -0,0 +1,13 @@
unit tudots;
interface
var
dot: record
test: integer;
end;
implementation
end.

View File

@ -0,0 +1,14 @@
{%norun}
program tudots.prog;
{$mode delphi}
uses
tudots;
begin
// this should not fail although we have a namespace tudots and a unit tudots
tudots.dot.test{ todo declaration:tudots.dot.test} := 1;
end.

View File

@ -0,0 +1,16 @@
{ %fail }
unit tudots.test;
interface
// this must fail
var
test: tudots.dot.next.ttest{ todo };
implementation
uses
tudots.dot.next{ todo declaration:tudots.dot.next};
end.