浏览代码

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