소스 검색

* Tests for NAMESPACES directive

Michaël Van Canneyt 2 년 전
부모
커밋
8ca4afd2d0
7개의 변경된 파일90개의 추가작업 그리고 0개의 파일을 삭제
  1. 15 0
      tests/test/nt.a.pp
  2. 15 0
      tests/test/nt.nst.pp
  3. 15 0
      tests/test/nt2.a.pp
  4. 15 0
      tests/test/nt2.nst2.pp
  5. 7 0
      tests/test/tnamesp.pp
  6. 8 0
      tests/test/tnamesp2.pp
  7. 15 0
      tests/test/tnamesp3.pp

+ 15 - 0
tests/test/nt.a.pp

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

+ 15 - 0
tests/test/nt.nst.pp

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

+ 15 - 0
tests/test/nt2.a.pp

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

+ 15 - 0
tests/test/nt2.nst2.pp

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

+ 7 - 0
tests/test/tnamesp.pp

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

+ 8 - 0
tests/test/tnamesp2.pp

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

+ 15 - 0
tests/test/tnamesp3.pp

@@ -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.