Skip to content

Commit f3a1342

Browse files
committed
Update & enhance snippet test information
Update `TestInfo` property of snippets that have demo code to `advanced`. Add new `AdvancedTest.Level` property that provides further information about testing of snippets which have `TestInfo=advanced`. Snippets that have demo code were given `AdvancedTest.Level` property with value `demo` while snippets that have unit tests were given `AdvancedTest.Level` property with value `unit-tests`. Add new `AdvancedTest.URL` property to all snippets with `TestInfo=advanced` that had value containing URL of related demo or unit test project.
1 parent 40d7c38 commit f3a1342

File tree

8 files changed

+232
-0
lines changed

8 files changed

+232
-0
lines changed

collection/arrays.ini

+2
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,8 @@ DescEx="<p>A method-only advanced record that provides utility methods for worki
353353
Units=Generics.Defaults
354354
SeeAlso=IndexOfByte,ByteArraysEqual,ByteArraysSameStart
355355
TestInfo=advanced
356+
AdvancedTest.Level=unit-tests
357+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Arrays"
356358
Snip=623.dat
357359
Delphi2=N
358360
Delphi3=N

collection/date.ini

+22
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ Extra="<p>Adapted from code contributed by Bill Miller.</p>"
5757
Units=SysUtils
5858
SeeAlso=DateMonth,DateYear,DayOfYear
5959
TestInfo=advanced
60+
AdvancedTest.Level=unit-tests
61+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Date"
6062
Snip=224.dat
6163
Delphi2=Y
6264
Delphi3=Y
@@ -107,6 +109,8 @@ Units=SysUtils
107109
SeeAlso=DateMonth,DateMonthStart,DaysInMonth
108110
Depends=DaysInMonth
109111
TestInfo=advanced
112+
AdvancedTest.Level=unit-tests
113+
AdvancedTest.URL="github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Date"
110114
Snip=441.dat
111115
Delphi2=Y
112116
Delphi3=Y
@@ -132,6 +136,8 @@ Extra="<p>The date returned is midnight at the beginning of the first day of the
132136
Units="SysUtils"
133137
SeeAlso=DateMonth,DateMonthEnd
134138
TestInfo=advanced
139+
AdvancedTest.Level=unit-tests
140+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Date"
135141
Snip=442.dat
136142
Delphi2=Y
137143
Delphi3=Y
@@ -157,6 +163,8 @@ Extra="<p>Based on code contributed by Homolibere.</p>"
157163
Units=SysUtils
158164
SeeAlso=DateQuarterStart,DateQuarterEnd
159165
TestInfo=advanced
166+
AdvancedTest.Level=unit-tests
167+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Date"
160168
Snip=413.dat
161169
Delphi2=Y
162170
Delphi3=Y
@@ -182,6 +190,8 @@ Extra="<p>Modified from code contributed by Homolibere.</p>"
182190
Units=SysUtils
183191
SeeAlso=DateQuarter,DateQuarterStart
184192
TestInfo=advanced
193+
AdvancedTest.Level=unit-tests
194+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Date"
185195
Snip=414.dat
186196
Delphi2=N
187197
Delphi3=N
@@ -207,6 +217,8 @@ Extra="<p>Modified from code contributed by Homolibere.</p>"
207217
Units=SysUtils
208218
SeeAlso=DateQuarter,DateQuarterEnd
209219
TestInfo=advanced
220+
AdvancedTest.Level=unit-tests
221+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Date"
210222
Snip=415.dat
211223
Delphi2=N
212224
Delphi3=N
@@ -301,6 +313,8 @@ Extra="<p>The date returned is midnight at the beginning of the last day of the
301313
Units=SysUtils
302314
SeeAlso=DateYear,DateYearStart
303315
TestInfo=advanced
316+
AdvancedTest.Level=unit-tests
317+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Date"
304318
Snip=443.dat
305319
Delphi2=Y
306320
Delphi3=Y
@@ -326,6 +340,8 @@ Extra="<p>The date returned is midnight at the beginning of the first day of the
326340
Units=SysUtils
327341
SeeAlso=DateYear,DateYearEnd
328342
TestInfo=advanced
343+
AdvancedTest.Level=unit-tests
344+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Date"
329345
Snip=444.dat
330346
Delphi2=Y
331347
Delphi3=Y
@@ -777,6 +793,8 @@ DescEx="<p>Formats a date in SQL format.</p>"
777793
Units=SysUtils
778794
SeeAlso=SQLDateToDateTime
779795
TestInfo=advanced
796+
AdvancedTest.Level=unit-tests
797+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Date"
780798
Snip=237.dat
781799
Delphi2=Y
782800
Delphi3=Y
@@ -802,6 +820,8 @@ Extra="<p>Handles only the date component. Any time component is ignored.</p>"
802820
Units=SysUtils
803821
SeeAlso=SQLDate
804822
TestInfo=advanced
823+
AdvancedTest.Level=unit-tests
824+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Date"
805825
Snip=412.dat
806826
Delphi2=Y
807827
Delphi3=Y
@@ -1381,6 +1401,8 @@ DescEx="<p>Returns the date of Easter Sunday for the given year in the Gregorian
13811401
Extra="<p>This routine is derived from a snippet taken from the SWAG Archive. That snippet was converted to Pascal by Kerry Sokalsky from Modula-2 code written by Greg Vigneault in 1993.</p><p>The algorithm was taken from chapter 4 of &quot;Astronomical Formulae for Calculators&quot; 2nd edition; by Jean Meeus; publisher: Willmann-Bell Inc., ISBN 0-943396-01-8.</p><p>The algorithm is valid for all years in the Gregorian calendar, i.e. from 1583 onwards. The extreme dates of Easter are March 22 (as in 1818 and 2285) and April 25 (as in 1886, 1943, 2038).</p><p>For more details of the algorithm see <a href="http://en.wikipedia.org/wiki/Computus#Anonymous_Gregorian_algorithm">this article</a> on Wikipedia.</p>"
13821402
Units=SysUtils
13831403
TestInfo=advanced
1404+
AdvancedTest.Level=unit-tests
1405+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Date"
13841406
Snip=610.dat
13851407
Delphi7=Y
13861408
Delphi2005Win32=Y

collection/drive.ini

+48
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
[CurentDrive]
99
DescEx="<p>Returns the letter that identifies the current drive.</p>"
1010
Extra="<p>Modified from Bill Miller's snippets collection.</p>"
11+
TestInfo=advanced
12+
AdvancedTest.Level=demo
13+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
1114
Snip=352.dat
1215
Delphi2=Y
1316
Delphi3=Y
@@ -32,6 +35,9 @@ DescEx="<p>Gets list of display names for all the system's drives and stores in
3235
Units=Classes,ShellAPI,SysUtils
3336
Depends=ListDrives,DriveDisplayName
3437
SeeAlso=DriveDisplayName,ListDrives
38+
TestInfo=advanced
39+
AdvancedTest.Level=demo
40+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
3541
Snip=070.dat
3642
Delphi2=N
3743
Delphi3=N
@@ -54,6 +60,9 @@ FPC=Y
5460
[DriveRootPath]
5561
DescEx="<p>Returns root drive path for drive with given number.</p>"
5662
SeeAlso=DriveTypeFromPath,IsValidDriveNum
63+
TestInfo=advanced
64+
AdvancedTest.Level=demo
65+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
5766
Snip=064.dat
5867
Delphi2=Y
5968
Delphi3=Y
@@ -77,6 +86,9 @@ FPC=Y
7786
DescEx="<p>Returns type of drive that contains the given (full) path.</p>"
7887
Units=Windows,SysUtils
7988
SeeAlso=DriveRootPath,DriveDisplayName,IsValidDrive
89+
TestInfo=advanced
90+
AdvancedTest.Level=demo
91+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
8092
Snip=028.dat
8193
Delphi2=Y
8294
Delphi3=Y
@@ -100,6 +112,9 @@ FPC=Y
100112
DescEx="<p>Returns name of a drive's file system or empty string if file system can't be determined or drive is not valid.</p>"
101113
Units=Windows
102114
SeeAlso=VolumeName
115+
TestInfo=advanced
116+
AdvancedTest.Level=demo
117+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
103118
Snip=138.dat
104119
Delphi2=N
105120
Delphi3=N
@@ -123,6 +138,9 @@ FPC=Y
123138
DescEx="<p>Returns the volume name of the given drive or empty string if the volume has no name or the drive is not valid.</p>"
124139
Units=Windows
125140
SeeAlso=FileSystemName,DeleteVolumeName,SetVolumeName
141+
TestInfo=advanced
142+
AdvancedTest.Level=demo
143+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
126144
Snip=137.dat
127145
Delphi2=N
128146
Delphi3=N
@@ -147,6 +165,9 @@ DescEx="<p>Deletes an existing volume label on a given drive. Returns True on su
147165
Extra="<p><warning>Note:</warning> Fails and returns False if the process has insufficient privileges to set the volume name.</p>"
148166
Units=Windows
149167
SeeAlso=VolumeName,SetVolumeName
168+
TestInfo=advanced
169+
AdvancedTest.Level=demo
170+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
150171
Snip=329.dat
151172
Delphi2=Y
152173
Delphi3=Y
@@ -170,6 +191,9 @@ FPC=Y
170191
DescEx="<p>Gets information about the size of a drive and the space available to the current user. Returns True if the the required information can be obtained and False if not.</p><p>On success <var>AvailBytes</var> is the amount of space available to the current user, <var>TotalBytes</var> is the total number of bytes on the disk that is available to the current user and <var>FreeBytes</var> is the total number of free bytes on the disk.</p>"
171192
Extra="<p>Drive must be a valid drive such as <mono>C:\</mono> or a UNC name such as <mono>\\MyServer\MyShare\</mono> (with trailing backslash).</p><p>If per-user disk quotas are being used then the value of <var>AvailBytes</var> maybe less than the free space available on the disk and <var>TotalBytes</var> may be less that the total number of bytes on the disk.</p><p>Loosely based on code contributed by Bill Miller.</p>"
172193
Units=SysUtils
194+
TestInfo=advanced
195+
AdvancedTest.Level=demo
196+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
173197
Snip=166.dat
174198
Delphi2=N
175199
Delphi3=N
@@ -194,6 +218,9 @@ DescEx="<p>Returns the display name for the drive with the given root path.</p>"
194218
Extra="<p><strong>Note:</strong> On versions of Delphi that do not support the <var>SysUtils.RaiseLastOSError</var> routine, this call can be replaced by <var>RaiseLastWin32Error</var>.</p>"
195219
Units=ShellAPI,SysUtils
196220
SeeAlso=DriveDisplayNames,DriveTypeFromPath,ListDrives
221+
TestInfo=advanced
222+
AdvancedTest.Level=demo
223+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
197224
Snip=069.dat
198225
Delphi2=N
199226
Delphi3=N
@@ -219,6 +246,9 @@ Extra="<p><var>Drive</var> can be specified as a disk letter (e.g. <mono>C</mono
219246
Units=SysUtils
220247
Depends=IsCharInSet
221248
SeeAlso=IsValidDriveNum
249+
TestInfo=advanced
250+
AdvancedTest.Level=demo
251+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
222252
Snip=164.dat
223253
Delphi2=Y
224254
Delphi3=Y
@@ -242,6 +272,9 @@ FPC=Y
242272
DescEx="<p>Returns the serial number of the volume whose root directory is contained in the <var>Drive</var> parameter. Returns 0 if the given drive is not valid or has no serial number.</p>"
243273
Extra="<p>The <var>Drive</var> parameter must either be the name of a local drive (e.g. <mono>C:\</mono>) or network share (e.g. <mono>\\MyServer\MyShare\</mono>). A trailing backslash must be provided. A drive letter on its own will not be recognised.</p>"
244274
Units=Windows
275+
TestInfo=advanced
276+
AdvancedTest.Level=demo
277+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
245278
Snip=066.dat
246279
Delphi2=Y
247280
Delphi3=Y
@@ -267,6 +300,9 @@ Extra="<p><var>Drive</var> can be specified as a disk letter (e.g. <mono>C</mono
267300
Units=Windows,SysUtils
268301
Depends=GetDriveNumber
269302
SeeAlso=IsValidDrive,DriveTypeFromPath
303+
TestInfo=advanced
304+
AdvancedTest.Level=demo
305+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
270306
Snip=165.dat
271307
Delphi2=Y
272308
Delphi3=Y
@@ -291,6 +327,9 @@ DescEx="<p>Checks if the given drive path represents a valid drive.</p>"
291327
Extra="<p>A valid drive can be a disk letter (e.g. <mono>C</mono>), a drive name (e.g <mono>C:</mono> or <mono>C:\</mono>) or an absolute file path on the drive (e.g. <mono>C:\Foo\Bar.txt</mono>).</p>"
292328
Depends=DriveTypeFromPath,IsDriveReady
293329
SeeAlso=IsValidDriveNum,DriveTypeFromPath
330+
TestInfo=advanced
331+
AdvancedTest.Level=demo
332+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
294333
Snip=072.dat
295334
Delphi2=Y
296335
Delphi3=Y
@@ -315,6 +354,9 @@ DescEx="<p>Returns True if the drive specified by the given number is valid and
315354
Extra="<p>Drive numbers must be in the range 0..25, with 0 mapping onto <mono>A:\</mono> and 25 mapping onto <mono>Z:\</mono>.</p>"
316355
Units=Windows
317356
SeeAlso=IsValidDrive,GetDriveNumber
357+
TestInfo=advanced
358+
AdvancedTest.Level=demo
359+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
318360
Snip=073.dat
319361
Delphi2=Y
320362
Delphi3=Y
@@ -340,6 +382,9 @@ Extra="<p><strong>Note:</strong> On versions of Delphi that do not support the <
340382
Units=Classes,Windows,SysUtils
341383
Depends=MultiSzToStrings
342384
SeeAlso=DriveDisplayName,DriveDisplayNames
385+
TestInfo=advanced
386+
AdvancedTest.Level=demo
387+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
343388
Snip=068.dat
344389
Delphi2=N
345390
Delphi3=N
@@ -364,6 +409,9 @@ DescEx="<p>Sets the name of the volume on a given drive. Returns True on success
364409
Extra="<p><warning>Note:</warning> Fails and returns False if the process has insufficient privileges to set the volume name.</p>"
365410
Units=Windows
366411
SeeAlso=DeleteVolumeName,VolumeName
412+
TestInfo=advanced
413+
AdvancedTest.Level=demo
414+
AdvancedTest.URL="https://github.com/delphidabbler/code-snippets/tree/master/tests/Cat-Drive"
367415
Snip=330.dat
368416
Delphi2=Y
369417
Delphi3=Y

0 commit comments

Comments
 (0)