瀏覽代碼

+ test for mantis #27522 (fixed in r29811)

git-svn-id: trunk@34601 -
Jonas Maebe 8 年之前
父節點
當前提交
a3afefc6cb
共有 5 個文件被更改,包括 86 次插入0 次删除
  1. 4 0
      .gitattributes
  2. 8 0
      tests/webtbs/tw27522.pp
  3. 36 0
      tests/webtbs/uw27522a.pp
  4. 15 0
      tests/webtbs/uw27522b.pp
  5. 23 0
      tests/webtbs/uw27522c.pp

+ 4 - 0
.gitattributes

@@ -15046,6 +15046,7 @@ tests/webtbs/tw27414.pp svneol=native#text/plain
 tests/webtbs/tw27424.pp svneol=native#text/pascal
 tests/webtbs/tw27424.pp svneol=native#text/pascal
 tests/webtbs/tw27515.pp svneol=native#text/pascal
 tests/webtbs/tw27515.pp svneol=native#text/pascal
 tests/webtbs/tw27517.pp svneol=native#text/pascal
 tests/webtbs/tw27517.pp svneol=native#text/pascal
+tests/webtbs/tw27522.pp svneol=native#text/plain
 tests/webtbs/tw27529.pp svneol=native#text/pascal
 tests/webtbs/tw27529.pp svneol=native#text/pascal
 tests/webtbs/tw2758.pp svneol=native#text/plain
 tests/webtbs/tw2758.pp svneol=native#text/plain
 tests/webtbs/tw2763.pp svneol=native#text/plain
 tests/webtbs/tw2763.pp svneol=native#text/plain
@@ -15907,6 +15908,9 @@ tests/webtbs/uw27294.pp svneol=native#text/plain
 tests/webtbs/uw2731.pp svneol=native#text/plain
 tests/webtbs/uw2731.pp svneol=native#text/plain
 tests/webtbs/uw27320.defaults.pp svneol=native#text/pascal
 tests/webtbs/uw27320.defaults.pp svneol=native#text/pascal
 tests/webtbs/uw2738.pp svneol=native#text/plain
 tests/webtbs/uw2738.pp svneol=native#text/plain
+tests/webtbs/uw27522a.pp svneol=native#text/plain
+tests/webtbs/uw27522b.pp svneol=native#text/plain
+tests/webtbs/uw27522c.pp svneol=native#text/plain
 tests/webtbs/uw2834.pp svneol=native#text/plain
 tests/webtbs/uw2834.pp svneol=native#text/plain
 tests/webtbs/uw28442.pp svneol=native#text/pascal
 tests/webtbs/uw28442.pp svneol=native#text/pascal
 tests/webtbs/uw28766.pp svneol=native#text/pascal
 tests/webtbs/uw28766.pp svneol=native#text/pascal

+ 8 - 0
tests/webtbs/tw27522.pp

@@ -0,0 +1,8 @@
+{ %opt=-gt }
+{ %recompile }
+{ %norun }
+
+program test;
+uses uw27522a;
+begin
+end.

+ 36 - 0
tests/webtbs/uw27522a.pp

@@ -0,0 +1,36 @@
+{$MODE OBJFPC} { -*- delphi -*- }
+{$CODEPAGE UTF8}
+unit uw27522a;
+
+interface
+
+uses
+   uw27522c;
+
+type
+   Test1Record = record
+     case Integer of
+        0: (Integer1, Integer2, Integer3: Integer);
+        1: (AsString: ShortString);
+   end;
+   operator + (const Op1: UTF8String; const Op2: Test1Record): UTF8String;
+
+implementation
+
+uses uw27522b, sysutils;
+
+operator + (const Op1: UTF8String; const Op2: Test1Record): UTF8String;
+begin
+   Result := '';
+end;
+
+function Test1A(const Value: TTest3): Test1Record;
+begin
+end;
+
+function Test1B(const Value: TTest3): Integer;
+begin
+   Writeln('' + IntToStr(Value.Value));
+end;
+
+end.

+ 15 - 0
tests/webtbs/uw27522b.pp

@@ -0,0 +1,15 @@
+{$MODE OBJFPC}
+unit uw27522b;
+
+interface
+
+implementation
+
+type
+   TTest2Callback = procedure() of object;
+
+function Test2(): TTest2Callback;
+begin
+end;
+
+end.

+ 23 - 0
tests/webtbs/uw27522c.pp

@@ -0,0 +1,23 @@
+{$MODE OBJFPC} { -*- delphi -*- }
+{$CODEPAGE UTF8}
+{$MODESWITCH ADVANCEDRECORDS+}
+unit uw27522c;
+
+interface
+
+type
+   TTest3 = record
+     Value: Integer;
+     function TestMethod(): UTF8String;
+   end;
+
+implementation
+
+uses uw27522b, sysutils, uw27522a;
+
+function TTest3.TestMethod(): UTF8String;
+begin
+    Result := '' + IntToStr(Value);
+end;
+
+end.