FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
DelphiCodeCoverage/Test/ClassInfoUnitTest.pas at master · DelphiCodeCoverage/DelphiCodeCoverage · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
DelphiCodeCoverage
/
DelphiCodeCoverage
Public
Notifications
You must be signed in to change notification settings
Fork
39
Star
94
Code
Issues
12
Pull requests
4
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
DelphiCodeCoverage
/
Test
/
ClassInfoUnitTest.pas
Copy path
More file actions
More file actions
Latest commit
History
History
History
124 lines (111 loc) · 3.57 KB
Breadcrumbs
DelphiCodeCoverage
/
Test
/
ClassInfoUnitTest.pas
Copy path
File metadata and controls
124 lines (111 loc) · 3.57 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
(*
*********************************************************************
*)
(*
Delphi Code Coverage
*)
(*
*)
(*
A quick hack of a Code Coverage Tool for Delphi
*)
(*
by Christer Fahlgren and Nick Ring
*)
(*
*)
(*
This Source Code Form is subject to the terms of the Mozilla Public
*)
(*
License, v. 2.0. If a copy of the MPL was not distributed with this
*)
(*
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*)
unit
ClassInfoUnitTest;
interface
uses
Classes,
SysUtils,
TestFramework,
ClassInfoUnit;
type
TClassInfoUnitTest =
class
(TTestCase)
private
published
procedure
TestClassInfo
;
procedure
TestGetProcedureName
;
procedure
TestGetClassName
;
end
;
implementation
procedure
TClassInfoUnitTest.TestClassInfo
;
var
cinfo : TClassInfo;
begin
cinfo:= TClassInfo.Create(
'
Module
'
,
'
MyClass
'
);
cinfo.ensureProcedure(
'
TestProcedure
'
);
end
;
procedure
TClassInfoUnitTest.TestGetProcedureName
;
begin
CheckEquals(
'
Bar
'
,
TModuleList.GetProcedureName(
'
foo
'
,
'
foo.Bar
'
),
'
foo.Bar should have Bar as procedure name
'
);
CheckEquals(
'
Baz
'
,
TModuleList.GetProcedureName(
'
foo
'
,
'
foo.Bar.Baz
'
),
'
foo.Bar.Baz should have Baz as procedure name
'
);
CheckEquals(
'
Baz
'
,
TModuleList.GetProcedureName(
'
foo
'
,
'
foo.Bar.Baz$0
'
),
'
foo.Bar.Baz$0 should have Baz as procedure name
'
);
CheckEquals(
'
'
,
TModuleList.GetProcedureName(
'
foo
'
,
'
foo.Bar.Baz$ActRec.$0$Body
'
),
'
foo.Bar.Baz$ActRec.$0$Body anonymous function should have no procedure name
'
);
CheckEquals(
'
Boo
'
,
TModuleList.GetProcedureName(
'
foo
'
,
'
foo.Bar.Baz.Boo
'
),
'
foo.Bar.Baz.Boo should have Boo as procedure name
'
);
CheckEquals(
'
Boo
'
,
TModuleList.GetProcedureName(
'
foo
'
,
'
foo.Bar.Baz.Boo$0
'
),
'
foo.Bar.Baz.Boo$0 should have Boo as procedure name
'
);
CheckEquals(
'
'
,
TModuleList.GetProcedureName(
'
foo
'
,
'
foo.Bar.Baz.Boo$ActRec.$0$Body
'
),
'
foo.Bar.Baz.Boo$ActRec.$0$Body anonymous function should have no procedure name
'
);
end
;
procedure
TClassInfoUnitTest.TestGetClassName
;
begin
CheckEquals(
'
Bar
'
,
TModuleList.GetClassName(
'
foo
'
,
'
foo.Bar
'
),
'
foo.Bar should have Bar as class name
'
);
CheckEquals(
'
Bar
'
,
TModuleList.GetClassName(
'
foo
'
,
'
foo.Bar.Baz
'
),
'
foo.Bar.Baz should have Bar as class name
'
);
CheckEquals(
'
Bar
'
,
TModuleList.GetClassName(
'
foo
'
,
'
foo.Bar.Baz$0
'
),
'
foo.Bar.Baz$0 should have Bar as class name
'
);
CheckEquals(
'
Bar.Baz$ActRec
'
,
TModuleList.GetClassName(
'
foo
'
,
'
foo.Bar.Baz$ActRec.$0$Body
'
),
'
foo.Bar.Baz$ActRec.$0$Body anonymous function should have Bar as class name
'
);
CheckEquals(
'
Bar.Baz
'
,
TModuleList.GetClassName(
'
foo
'
,
'
foo.Bar.Baz.Boo
'
),
'
foo.Bar.Baz.Boo should have Bar.Baz as class name
'
);
CheckEquals(
'
Bar.Baz
'
,
TModuleList.GetClassName(
'
foo
'
,
'
foo.Bar.Baz.Boo$0$Body
'
),
'
foo.Bar.Baz.Boo$0$Body should have Bar.Baz as class name
'
);
CheckEquals(
'
Bar.Baz
'
,
TModuleList.GetClassName(
'
foo
'
,
'
foo.Bar.Baz.$0$Body
'
),
'
foo.Bar.Baz.$0$Body anonymous function should have Bar as class name
'
);
end
;
//
==============================================================================
initialization
RegisterTest(TClassInfoUnitTest.Suite);
end
.
Back
|
FazBrowse Home
|
New Git URL