ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
test_pm_strASCII.F90
Go to the documentation of this file.
1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3!!!! !!!!
4!!!! ParaMonte: Parallel Monte Carlo and Machine Learning Library. !!!!
5!!!! !!!!
6!!!! Copyright (C) 2012-present, The Computational Data Science Lab !!!!
7!!!! !!!!
8!!!! This file is part of the ParaMonte library. !!!!
9!!!! !!!!
10!!!! LICENSE !!!!
11!!!! !!!!
12!!!! https://github.com/cdslaborg/paramonte/blob/main/LICENSE.md !!!!
13!!!! !!!!
14!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
15!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16
24
25!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26
28
29 use pm_strASCII
30 use pm_kind, only: LK
31 use pm_container, only: strc => css_pdt
32 use pm_test, only: test_type, LK
33 implicit none
34
35 private
36 public :: setTest
37 type(test_type) :: test
38
39 type(strc), allocatable :: NonIntSet(:)
40 type(strc), allocatable :: IntSet(:)
41 type(strc), allocatable :: RealSet(:)
42 type(strc), allocatable :: NonRealSet(:)
43
44!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
45
46contains
47
48!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49
50 function test_getLocSpace_1() result(assertion)
51 logical(LK) :: assertion
52 assertion = .true._LK
53 assertion = assertion .and. getLocSpace(SK_"") == 0_IK
54 call test%assert(assertion, MODULE_NAME//SK_': The condition `getLocSpace(SK_"") == 0_IK` must hold.')
55 assertion = assertion .and. getLocSpace(SK_" ") == 1_IK
56 call test%assert(assertion, MODULE_NAME//SK_': The condition `getLocSpace(SK_" ") == 1_IK` must hold.')
57 assertion = assertion .and. getLocSpace(SK_" paramonte") == 1_IK
58 call test%assert(assertion, MODULE_NAME//SK_': The condition `getLocSpace(SK_" paramonte") == 1_IK` must hold.')
59 assertion = assertion .and. getLocSpace(SK_"paramonte ") == 10_IK
60 call test%assert(assertion, MODULE_NAME//SK_': The condition `getLocSpace(SK_"paramonte ") == 10_IK` must hold.')
61 assertion = assertion .and. getLocSpace(SK_"paramonte") == 0_IK
62 call test%assert(assertion, MODULE_NAME//SK_': The condition `getLocSpace(SK_"paramonte") == 0_IK` must hold.')
63 end function
64
65!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66
67 function test_isCharDigit_1() result(assertion)
68 use pm_val2str, only: getStr
69 implicit none
70 logical(LK) :: assertion
71 integer(IK) :: i
72 assertion = .true._LK
73 do i = 1, 127
74 if (index(SK_"0123456789", achar(i, kind = SK)) > 0) then
75 assertion = assertion .and. isCharDigit(achar(i))
76 else
77 assertion = assertion .and. .not. isCharDigit(achar(i))
78 end if
79 call test%assert(assertion, MODULE_NAME//SK_"isCharDigit() must correctly identify "//achar(i)//SK_" as a digit or a non-digit.")
80 end do
81 assertion = assertion .and. all(isCharDigit([SK_"0", SK_" ", SK_"+", SK_"."]) .eqv. [.true._LK, .false._LK, .false._LK, .false._LK])
82 call test%assert(assertion, MODULE_NAME//SK_'isCharDigit() must correctly identify [SK_"0", SK_" ", SK_"+", SK_"."] as digits or non-digits.')
83 end function
84
85!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
86
87 function test_isStrDigitAll_1() result(assertion)
88 use pm_val2str, only: getStr
89 implicit none
90 logical(LK) :: assertion
91 integer(IK) :: i
92 assertion = .true._LK
93 do i = 0, 9
94 assertion = assertion .and. isStrDigitAll(SK_"0")
95 call test%assert(assertion, MODULE_NAME//SK_"isStrDigitAll() must correctly identify "//getStr(i)//SK_" as numeric.")
96 end do
97 assertion = assertion .and. isStrDigitAll(SK_"0123")
98 call test%assert(assertion, MODULE_NAME//SK_"@isStrDigitAll() must correctly identify `0123` as numeric.")
99 assertion = assertion .and. .not. isStrDigitAll(SK_"123.")
100 call test%assert(assertion, MODULE_NAME//SK_"@isStrDigitAll() must correctly identify `123.` as not numeric.")
101 assertion = assertion .and. .not. isStrDigitAll(SK_"123 ")
102 call test%assert(assertion, MODULE_NAME//SK_"@isStrDigitAll() must correctly identify `123 ` as not numeric.")
103 assertion = assertion .and. .not. isStrDigitAll(SK_" ")
104 call test%assert(assertion, MODULE_NAME//SK_"@isStrDigitAll() must correctly identify ` ` as not numeric.")
105 assertion = assertion .and. .not. isStrDigitAll(SK_"-123")
106 call test%assert(assertion, MODULE_NAME//SK_"@isStrDigitAll() must correctly identify `-123` as not numeric.")
107 assertion = assertion .and. .not. isStrDigitAll(SK_"")
108 call test%assert(assertion, MODULE_NAME//SK_"@isStrDigitAll() must correctly identify `` as not numeric.")
109 end function
110
111!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
112
113 function test_isStrReal_1() result(assertion)
114 use pm_val2str, only: getStr
115 implicit none
116 logical(LK) :: assertion
117 integer(IK) :: i
118 assertion = .true._LK
119 do i = 1, size(IntSet)
120 assertion = assertion .and. isStrReal(IntSet(i)%val)
121 call test%assert(assertion, MODULE_NAME//SK_"isStrReal() must correctly identify """//IntSet(i)%val//SK_""" as a real number.")
122 end do
123 do i = 1, size(RealSet)
124 assertion = assertion .and. isStrReal(RealSet(i)%val)
125 call test%assert(assertion, MODULE_NAME//SK_"isStrReal() must correctly identify """//RealSet(i)%val//SK_""" as a real number.")
126 end do
127 do i = 1, size(NonRealSet)
128 assertion = assertion .and. .not. isStrReal(NonRealSet(i)%val)
129 call test%assert(assertion, MODULE_NAME//SK_"isStrReal() must correctly identify """//NonRealSet(i)%val//SK_""" as not a real number.")
130 end do
131 end function
132
133!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
134
135 function test_isStrInteger_1() result(assertion)
136 use pm_val2str, only: getStr
137 implicit none
138 logical(LK) :: assertion
139 integer(IK) :: i
140 assertion = .true._LK
141 do i = 1, size(IntSet)
142 assertion = assertion .and. isStrInteger(IntSet(i)%val)
143 call test%assert(assertion, MODULE_NAME//SK_"isStrInteger() must correctly identify """//IntSet(i)%val//SK_""" as an integer number.")
144 end do
145 do i = 1, size(NonIntSet)
146 assertion = assertion .and. .not. isStrInteger(NonIntSet(i)%val)
147 call test%assert(assertion, MODULE_NAME//SK_"isStrInteger() must correctly identify """//NonIntSet(i)%val//SK_""" as not an integer number.")
148 end do
149 end function
150
151
152!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
153
154 function test_isStrNumber_1() result(assertion)
155 use pm_val2str, only: getStr
156 implicit none
157 logical(LK) :: assertion
158 integer(IK) :: i
159 assertion = .true._LK
160 do i = 0, 9
161 assertion = assertion .and. isStrNumber(SK_"0")
162 call test%assert(assertion, MODULE_NAME//SK_"isStrNumber() must correctly identify "//getStr(i)//SK_" as numeric.")
163 end do
164 assertion = assertion .and. isStrNumber(SK_"0123")
165 call test%assert(assertion, MODULE_NAME//SK_"@isStrNumber() must correctly identify `0123` as a number.")
166 assertion = assertion .and. isStrNumber(SK_"123.")
167 call test%assert(assertion, MODULE_NAME//SK_"@isStrNumber() must correctly identify `123.` as a number.")
168 assertion = assertion .and. isStrNumber(SK_"123 ")
169 call test%assert(assertion, MODULE_NAME//SK_"@isStrNumber() must correctly identify `123 ` as a number.")
170 assertion = assertion .and. isStrNumber(SK_" 13 ")
171 call test%assert(assertion, MODULE_NAME//SK_"@isStrNumber() must correctly identify ` 13 ` as a number.")
172 assertion = assertion .and. isStrNumber(SK_"-13 ")
173 call test%assert(assertion, MODULE_NAME//SK_"@isStrNumber() must correctly identify `-13 ` as a number.")
174 assertion = assertion .and. isStrNumber(SK_"-13.")
175 call test%assert(assertion, MODULE_NAME//SK_"@isStrNumber() must correctly identify `-13.` as a number.")
176 assertion = assertion .and. isStrNumber(SK_"+13.")
177 call test%assert(assertion, MODULE_NAME//SK_"@isStrNumber() must correctly identify `+13.` as a number.")
178 assertion = assertion .and. isStrNumber(SK_" +3 ")
179 call test%assert(assertion, MODULE_NAME//SK_"@isStrNumber() must correctly identify ` +3 ` as a number.")
180 assertion = assertion .and. isStrNumber(SK_" +3 ")
181 call test%assert(assertion, MODULE_NAME//SK_"@isStrNumber() must correctly identify ` +3 ` as a number.")
182 assertion = assertion .and. .not. isStrNumber(SK_" ")
183 call test%assert(assertion, MODULE_NAME//SK_"@isStrNumber() must correctly identify ` ` as not numeric.")
184 assertion = assertion .and. isStrNumber(SK_"-123")
185 call test%assert(assertion, MODULE_NAME//SK_"@isStrNumber() must correctly identify `-123` as not numeric.")
186 end function
187
188!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
189
190 function test_isCharLower_1() result(assertion)
191 logical(LK) :: assertion
192 integer(IK) :: i
193 assertion = .true._LK
194 do i = 1_IK, 127_IK
195 assertion = assertion .and. (isCharLower(char(i, kind = SK)) .eqv. any(ALPHA_LOWER_VEC_SK == char(i, kind = SK)))
196 call test%assert(assertion, MODULE_NAME//SK_': isCharLower() must properly recognize lower-case characters.')
197 end do
198 end function
199
200!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
201
202 function test_isCharUpper_1() result(assertion)
203 logical(LK) :: assertion
204 integer(IK) :: i
205 assertion = .true._LK
206 do i = 1_IK, 127_IK
207 assertion = assertion .and. (isCharUpper(char(i, kind = SK)) .eqv. any(ALPHA_UPPER_VEC_SK == char(i, kind = SK)))
208 call test%assert(assertion, MODULE_NAME//SK_': isCharUpper() must properly recognize upper-case characters.')
209 end do
210 end function
211
212!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
213
214 function test_isStrLowerAll_1() result(assertion)
215 logical(LK) :: assertion
216 integer(IK) :: i
217 assertion = .true._LK
218 assertion = assertion .and. .not. isStrLowerAll(SK_"")
219 call test%assert(assertion, MODULE_NAME//SK_.not.': The condition ` isStrLowerAll(SK_"")` must hold.')
220 do i = 1_IK, 127_IK
221 assertion = assertion .and. (isStrLowerAll(char(i, kind = SK)) .eqv. any(ALPHA_LOWER_VEC_SK == char(i, kind = SK)))
222 call test%assert(assertion, MODULE_NAME//SK_': isStrLowerAll() must properly recognize upper-case characters.')
223 end do
224 assertion = assertion .and. isStrLowerAll(SK_"paramonte")
225 call test%assert(assertion, MODULE_NAME//SK_': `isStrLowerAll(SK_"paramonte")` must hold.')
226 assertion = assertion .and. .not. isStrLowerAll(SK_"PARAMONTE ")
227 call test%assert(assertion, MODULE_NAME//SK_': `isStrLowerAll(SK_"PARAMONTE ")` must not hold.')
228 assertion = assertion .and. .not. isStrLowerAll(SK_"paramonte ")
229 call test%assert(assertion, MODULE_NAME//SK_': `isStrLowerAll(SK_"paramonte ")` must not hold.')
230 assertion = assertion .and. .not. isStrLowerAll(SK_"paraMONTE")
231 call test%assert(assertion, MODULE_NAME//SK_': `isStrLowerAll(SK_"paraMONTE")` must not hold.')
232 assertion = assertion .and. .not. isStrLowerAll(SK_"+paramonte1")
233 call test%assert(assertion, MODULE_NAME//SK_': `isStrLowerAll(SK_"+paramonte1")` must not hold.')
234 assertion = assertion .and. .not. isStrLowerAll(SK_"paramonte1")
235 call test%assert(assertion, MODULE_NAME//SK_': `isStrLowerAll(SK_"paramonte1")` must not hold.')
236 end function
237
238!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
239
240 function test_isStrUpperAll_1() result(assertion)
241 logical(LK) :: assertion
242 integer(IK) :: i
243 assertion = .true._LK
244 assertion = assertion .and. .not. isStrUpperAll(SK_"")
245 call test%assert(assertion, MODULE_NAME//SK_.not.': The condition ` isStrUpperAll(SK_"")` must hold.')
246 do i = 1_IK, 127_IK
247 assertion = assertion .and. (isStrUpperAll(char(i, kind = SK)) .eqv. any(ALPHA_UPPER_VEC_SK == char(i, kind = SK)))
248 call test%assert(assertion, MODULE_NAME//SK_': isStrUpperAll() must properly recognize upper-case characters.')
249 end do
250 assertion = assertion .and. isStrUpperAll(SK_"PARAMONTE")
251 call test%assert(assertion, MODULE_NAME//SK_': `isStrUpperAll(SK_"PARAMONTE")` must hold.')
252 assertion = assertion .and. .not. isStrUpperAll(SK_"PARAMONTE ")
253 call test%assert(assertion, MODULE_NAME//SK_': `isStrUpperAll(SK_"PARAMONTE ")` must not hold.')
254 assertion = assertion .and. .not. isStrUpperAll(SK_"paramonte ")
255 call test%assert(assertion, MODULE_NAME//SK_': `isStrUpperAll(SK_"paramonte ")` must not hold.')
256 assertion = assertion .and. .not. isStrUpperAll(SK_"paraMONTE")
257 call test%assert(assertion, MODULE_NAME//SK_': `isStrUpperAll(SK_"paraMONTE")` must not hold.')
258 assertion = assertion .and. .not. isStrUpperAll(SK_"+PARAMONTE1")
259 call test%assert(assertion, MODULE_NAME//SK_': `isStrUpperAll(SK_"+PARAMONTE1")` must not hold.')
260 assertion = assertion .and. .not. isStrUpperAll(SK_"PARAMONTE1")
261 call test%assert(assertion, MODULE_NAME//SK_': `isStrUpperAll(SK_"PARAMONTE1")` must not hold.')
262 end function
263
264!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
265
266 function test_isStrAlphaNumAll_1() result(assertion)
267 logical(LK) :: assertion
268 integer(IK) :: i
269 assertion = .true._LK
270 assertion = assertion .and. .not. isStrAlphaNumAll(SK_"")
271 call test%assert(assertion, MODULE_NAME//SK_.not.': The condition ` isStrAlphaNumAll(SK_"")` must hold.')
272 do i = 1_IK, 127_IK
273 assertion = assertion .and. (isStrAlphaNumAll(char(i, kind = SK)) .eqv. any(ALPHANUM_VEC_SK == char(i, kind = SK)))
274 call test%assert(assertion, MODULE_NAME//SK_': isStrAlphaNumAll() must properly recognize upper-case characters.')
275 end do
276 assertion = assertion .and. isStrAlphaNumAll(SK_"paramonte")
277 call test%assert(assertion, MODULE_NAME//SK_': `isStrAlphaNumAll(SK_"paramonte")` must hold.')
278 assertion = assertion .and. isStrAlphaNumAll(SK_"paramonte1")
279 call test%assert(assertion, MODULE_NAME//SK_': `isStrAlphaNumAll(SK_"paramonte1")` must hold.')
280 assertion = assertion .and. isStrAlphaNumAll(SK_"paraMONTE1")
281 call test%assert(assertion, MODULE_NAME//SK_': `isStrAlphaNumAll(SK_"paraMONTE1")` must hold.')
282 assertion = assertion .and. isStrAlphaNumAll(SK_"PARAMONTE")
283 call test%assert(assertion, MODULE_NAME//SK_': `isStrAlphaNumAll(SK_"PARAMONTE")` must hold.')
284 assertion = assertion .and. isStrAlphaNumAll(SK_"012345")
285 call test%assert(assertion, MODULE_NAME//SK_': `isStrAlphaNumAll(SK_"012345")` must hold.')
286 assertion = assertion .and. .not. isStrAlphaNumAll(SK_"PARAMONTE ")
287 call test%assert(assertion, MODULE_NAME//SK_': `isStrAlphaNumAll(SK_"PARAMONTE ")` must not hold.')
288 assertion = assertion .and. .not. isStrAlphaNumAll(SK_"paramonte+")
289 call test%assert(assertion, MODULE_NAME//SK_': `isStrAlphaNumAll(SK_"paramonte+")` must not hold.')
290 assertion = assertion .and. .not. isStrAlphaNumAll(SK_" paraMONTE")
291 call test%assert(assertion, MODULE_NAME//SK_': `isStrAlphaNumAll(SK_" paraMONTE")` must not hold.')
292 end function
293
294!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
295
296 function test_isStrAlpha_1() result(assertion)
297 logical(LK) :: assertion
298 integer(IK) :: i
299 assertion = .true._LK
300 assertion = assertion .and. .not. isStrAlpha(SK_"")
301 call test%assert(assertion, MODULE_NAME//SK_.not.': The condition ` isStrAlpha(SK_"")` must hold.')
302 do i = 1_IK, 127_IK
303 assertion = assertion .and. (isStrAlpha(char(i, kind = SK)) .eqv. any(ALPHA_VEC_SK == char(i, kind = SK)))
304 call test%assert(assertion, MODULE_NAME//SK_': isStrAlpha() must properly recognize upper-case characters.')
305 end do
306 assertion = assertion .and. isStrAlpha(SK_"paramonte")
307 call test%assert(assertion, MODULE_NAME//SK_': `isStrAlpha(SK_"paramonte")` must hold.')
308 assertion = assertion .and. isStrAlpha(SK_"PARAMONTE")
309 call test%assert(assertion, MODULE_NAME//SK_': `isStrAlpha(SK_"PARAMONTE")` must hold.')
310 assertion = assertion .and. .not. isStrAlpha(SK_"012345")
311 call test%assert(assertion, MODULE_NAME//SK_': `isStrAlpha(SK_"012345")` must not hold.')
312 assertion = assertion .and. .not. isStrAlpha(SK_"paramonte1")
313 call test%assert(assertion, MODULE_NAME//SK_': `isStrAlpha(SK_"paramonte1")` must not hold.')
314 assertion = assertion .and. .not. isStrAlpha(SK_"paraMONTE1")
315 call test%assert(assertion, MODULE_NAME//SK_': `isStrAlpha(SK_"paraMONTE1")` must not hold.')
316 assertion = assertion .and. .not. isStrAlpha(SK_"PARAMONTE ")
317 call test%assert(assertion, MODULE_NAME//SK_': `isStrAlpha(SK_"PARAMONTE ")` must not hold.')
318 assertion = assertion .and. .not. isStrAlpha(SK_"paramonte+")
319 call test%assert(assertion, MODULE_NAME//SK_': `isStrAlpha(SK_"paramonte+")` must not hold.')
320 assertion = assertion .and. .not. isStrAlpha(SK_" paraMONTE")
321 call test%assert(assertion, MODULE_NAME//SK_': `isStrAlpha(SK_" paraMONTE")` must not hold.')
322 end function
323
324!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
325
326 function test_getStrLower_1() result(assertion)
327
328 logical(LK) :: assertion
329 character(:, SK), allocatable :: string
330 character(:, SK), allocatable :: strout
331 assertion = .true._LK
332
333 string = SK_" StringString !@#$"
334 strout = getStrLower(string)
335 assertion = assertion .and. strout == SK_" stringstring !@#$"
336 call test%assert(assertion, MODULE_NAME//SK_': `getStrLower(SK_"'//string//'")` must yield correct answer.')
337
338 string = SK_""
339 strout = getStrLower(string)
340 assertion = assertion .and. strout == SK_""
341 call test%assert(assertion, MODULE_NAME//SK_': `getStrLower(SK_"'//string//'")` must yield correct answer.')
342
343 end function
344
345!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
346
347 function test_getStrUpper_1() result(assertion)
348
349 logical(LK) :: assertion
350 character(:, SK), allocatable :: string
351 character(:, SK), allocatable :: strout
352 assertion = .true._LK
353
354 string = SK_" StringString !@#$"
355 strout = getStrUpper(string)
356 assertion = assertion .and. strout == SK_" STRINGSTRING !@#$"
357 call test%assert(assertion, MODULE_NAME//SK_': `getStrUpper(SK_"'//string//'")` must yield correct answer.')
358
359 string = SK_""
360 strout = getStrUpper(string)
361 assertion = assertion .and. strout == SK_""
362 call test%assert(assertion, MODULE_NAME//SK_': `getStrUpper(SK_"'//string//'")` must yield correct answer.')
363
364 end function
365
366!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
367
368 function test_setStrLower_1() result(assertion)
369
370 logical(LK) :: assertion
371 character(:, SK), allocatable :: string
372 assertion = .true._LK
373
374 string = SK_" StringString !@#$"
375 call setStrLower(string)
376 assertion = assertion .and. string == SK_" stringstring !@#$"
377 call test%assert(assertion, MODULE_NAME//SK_': `setStrLower(SK_"'//string//'")` must yield correct answer.')
378
379 string = SK_""
380 call setStrLower(string)
381 assertion = assertion .and. string == SK_""
382 call test%assert(assertion, MODULE_NAME//SK_': `setStrLower(SK_"'//string//'")` must yield correct answer.')
383
384 end function
385
386!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
387
388 function test_setStrUpper_1() result(assertion)
389
390 logical(LK) :: assertion
391 character(:, SK), allocatable :: string
392 assertion = .true._LK
393
394 string = SK_" StringString !@#$"
395 call setStrUpper(string)
396 assertion = assertion .and. string == SK_" STRINGSTRING !@#$"
397 call test%assert(assertion, MODULE_NAME//SK_': `setStrUpper(SK_"'//string//'")` must yield correct answer.')
398
399 string = SK_""
400 call setStrUpper(string)
401 assertion = assertion .and. string == SK_""
402 call test%assert(assertion, MODULE_NAME//SK_': `setStrUpper(SK_"'//string//'")` must yield correct answer.')
403
404 end function
405
406!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
407
408! function test_setStrAlphaRand_1() result(assertion)
409! use pm_distUnif, only: getUnifRand
410! use pm_str, only: getCharVec
411! logical(LK) :: assertion
412! character(:, SK), allocatable :: string
413! integer(IK) :: i
414! assertion = .true._LK
415! do i = 1_IK, 127_IK
416! allocate(character(getUnifRand(0_IK,10_IK), SK) :: string)
417! call setStrAlphaRand(string)
418! assertion = assertion .and. (isStrAlpha(string) .or. len(string) == 0)
419! call test%assert(assertion, MODULE_NAME//SK_': `setStrAlphaRand(string)` must yield characters within the alphabetic bounds: "'//string//SK_'"')
420! deallocate(string)
421! end do
422! end function
423
424!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
425
426! function test_setStrAlphaRandLower_1() result(assertion)
427! use pm_distUnif, only: getUnifRand
428! use pm_str, only: getCharVec
429! logical(LK) :: assertion
430! character(:, SK), allocatable :: string
431! integer(IK) :: i
432! assertion = .true._LK
433! do i = 1_IK, 127_IK
434! allocate(character(getUnifRand(0_IK,10_IK), SK) :: string)
435! call setStrAlphaRandLower(string)
436! assertion = assertion .and. ((all(SK_"a" <= getCharVec(string)) .and. all(getCharVec(string) <= SK_"z")) .or. len(string) == 0)
437! call test%assert(assertion, MODULE_NAME//SK_': `setStrAlphaRandLower(string)` must yield characters within the alphabetic bounds: "'//string//SK_'"')
438! deallocate(string)
439! end do
440! end function
441!
442!!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
443!
444! function test_setStrAlphaRandUpper_1() result(assertion)
445! use pm_distUnif, only: getUnifRand
446! use pm_str, only: getCharVec
447! logical(LK) :: assertion
448! character(:, SK), allocatable :: string
449! integer(IK) :: i
450! assertion = .true._LK
451! do i = 1_IK, 127_IK
452! allocate(character(getUnifRand(0_IK,10_IK), SK) :: string)
453! call setStrAlphaRandUpper(string)
454! assertion = assertion .and. ((all(SK_"A" <= getCharVec(string)) .and. all(getCharVec(string) <= SK_"Z")) .or. len(string) == 0)
455! call test%assert(assertion, MODULE_NAME//SK_': `setStrAlphaRandUpper(string)` must yield characters within the alphabetic bounds: "'//string//SK_'"')
456! deallocate(string)
457! end do
458! end function
459
460!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
461
462 function test_isStrComplex_1() result(assertion)
463 use pm_distUnif, only: setUnifRand
464 use pm_val2str, only: getStr
465 implicit none
466 logical(LK) :: assertion
467 character(:, SK), allocatable :: cmplx
468 integer(IK) :: i
469 assertion = .true._LK
470 do i = 1_IK, 1000_IK
471 cmplx = getComplexStr()
472 assertion = assertion .and. isStrComplex(cmplx)
473 call test%assert(assertion, MODULE_NAME//SK_"isStrComplex() must correctly identify """//cmplx//SK_""" as a complex number.")
474 cmplx = getNonComplexStr()
475 assertion = assertion .and. .not. isStrComplex(cmplx)
476 call test%assert(assertion, MODULE_NAME//SK_"isStrComplex() must correctly identify """//cmplx//SK_""" as not a complex number.")
477 end do
478 assertion = assertion .and. .not. isStrComplex(SK_"")
479 call test%assert(assertion, MODULE_NAME//SK_"isStrComplex() must correctly identify `""""` as not a complex number.")
480 assertion = assertion .and. .not. isStrComplex(SK_"123")
481 call test%assert(assertion, MODULE_NAME//SK_"isStrComplex() must correctly identify `""123""` as not a complex number.")
482 assertion = assertion .and. .not. isStrComplex(SK_"123.0")
483 call test%assert(assertion, MODULE_NAME//SK_"isStrComplex() must correctly identify `""123.0""` as not a complex number.")
484 assertion = assertion .and. .not. isStrComplex(SK_"-.01e+5")
485 call test%assert(assertion, MODULE_NAME//SK_"isStrComplex() must correctly identify `""-.01e+5""` as not a complex number.")
486 end function
487
488!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
489
492 function getComplexStr(lp, rp, sep) result(cmplx)
493 use pm_distUnif, only: getUnifRand
494 character(*, SK), intent(in), optional :: lp, rp, sep
495 character(:, SK), allocatable :: lm, rm, lp_def, rp_def, sep_def, real, imag, cmplx
496 lp_def = SK_"("
497 rp_def = SK_")"
498 sep_def = SK_","
499 if (present(lp)) lp_def = lp
500 if (present(rp)) rp_def = rp
501 if (present(sep)) sep_def = sep
502 lm = repeat(SK_" ", getUnifRand(0_IK, 3_IK))
503 rm = repeat(SK_" ", getUnifRand(0_IK, 3_IK))
504 real = getRealStr()
505 imag = getRealStr()
506 cmplx = lm//lp_def//real//sep_def//imag//rp_def//rm
507 end function
508
509!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
510
513 function getNonComplexStr() result(cmplx)
514 use pm_distUnif, only: getUnifRand
515 use pm_distUnif, only: setUnifRand
516 character(:, SK), allocatable :: cmplx
517 character(:, SK), allocatable :: lm, rm, real, imag
518 character(1, SK) :: lp, rp, sep
519 if (getUnifRand()) then
520 real = getRealStr()
521 imag = getRealStr()
522 call setUnifRand(lp)
523 call setUnifRand(rp)
524 call setUnifRand(sep)
525 cmplx = getComplexStr(lp, rp, sep)
526 else
527 lm = repeat(SK_" ", getUnifRand(0_IK, 3_IK))
528 rm = repeat(SK_" ", getUnifRand(0_IK, 3_IK))
529 real = getNonRealStr()
530 imag = getNonRealStr()
531 sep = SK_","
532 lp = SK_"("
533 rp = SK_")"
534 cmplx = lm//lp//real//sep//imag//rp//rm
535 end if
536 end function
537
538!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
539
542 function getRealStr() result(real)
543 use pm_distUnif, only: getUnifRand
544 character(:, SK), allocatable :: real
545 if (getUnifRand()) then
546 real = IntSet(getUnifRand(1_IK, size(IntSet, kind = IK)))%val
547 else
548 real = RealSet(getUnifRand(1_IK, size(RealSet, kind = IK)))%val
549 end if
550 real = repeat(SK_" ", getUnifRand(0_IK, 3_IK)) // real // repeat(SK_" ", getUnifRand(0_IK, 3_IK))
551 end function
552
553!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
554
557 function getNonRealStr() result(real)
558 use pm_distUnif, only: getUnifRand
559 character(:, SK), allocatable :: real
560 if (getUnifRand()) then
561 do
562 real = NonIntSet(getUnifRand(1_IK, size(NonIntSet, kind = IK)))%val
563 if (.not. isStrReal(real)) exit
564 end do
565 else
566 real = NonRealSet(getUnifRand(1_IK, size(NonRealSet, kind = IK)))%val
567 end if
568 real = repeat(SK_" ", getUnifRand(0_IK, 3_IK)) // real // repeat(SK_" ", getUnifRand(0_IK, 3_IK))
569 end function
570
571!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
572
575 subroutine setData()
576 IntSet = [ strc(SK_"0") & ! LCOV_EXCL_LINE
577 , strc(SK_"1") & ! LCOV_EXCL_LINE
578 , strc(SK_"2") & ! LCOV_EXCL_LINE
579 , strc(SK_"3") & ! LCOV_EXCL_LINE
580 , strc(SK_"4") & ! LCOV_EXCL_LINE
581 , strc(SK_"5") & ! LCOV_EXCL_LINE
582 , strc(SK_"6") & ! LCOV_EXCL_LINE
583 , strc(SK_"7") & ! LCOV_EXCL_LINE
584 , strc(SK_"8") & ! LCOV_EXCL_LINE
585 , strc(SK_"9") & ! LCOV_EXCL_LINE
586 , strc(SK_" 13 ") & ! LCOV_EXCL_LINE
587 , strc(SK_"-13 ") & ! LCOV_EXCL_LINE
588 , strc(SK_" +3 ") & ! LCOV_EXCL_LINE
589 , strc(SK_"123 ") & ! LCOV_EXCL_LINE
590 , strc(SK_"0123") & ! LCOV_EXCL_LINE
591 , strc(SK_"-123") & ! LCOV_EXCL_LINE
592 , strc(SK_" -123 ") & ! LCOV_EXCL_LINE
593 ]
594 NonIntSet = [ strc(SK_"0+") & ! LCOV_EXCL_LINE
595 , strc(SK_"") & ! LCOV_EXCL_LINE
596 , strc(SK_" ") & ! LCOV_EXCL_LINE
597 , strc(SK_"+") & ! LCOV_EXCL_LINE
598 , strc(SK_"-") & ! LCOV_EXCL_LINE
599 , strc(SK_".") & ! LCOV_EXCL_LINE
600 , strc(SK_"- 123 ") & ! LCOV_EXCL_LINE
601 , strc(SK_" - 123 ") & ! LCOV_EXCL_LINE
602 , strc(SK_" +1 23 ") & ! LCOV_EXCL_LINE
603 , strc(SK_" +1 23 ") & ! LCOV_EXCL_LINE
604 , strc(SK_" +123. ") & ! LCOV_EXCL_LINE
605 , strc(SK_" +123.1 ") & ! LCOV_EXCL_LINE
606 , strc(SK_"123.1") & ! LCOV_EXCL_LINE
607 , strc(SK_"-423.1") & ! LCOV_EXCL_LINE
608 , strc(SK_"++423") & ! LCOV_EXCL_LINE
609 , strc(SK_"+-3456") & ! LCOV_EXCL_LINE
610 ]
611 RealSet = [ strc(SK_"123.") & ! LCOV_EXCL_LINE
612 , strc(SK_"-13.") & ! LCOV_EXCL_LINE
613 , strc(SK_"+13.") & ! LCOV_EXCL_LINE
614 , strc(SK_" -.1 ") & ! LCOV_EXCL_LINE
615 , strc(SK_" -.1d-12 ") & ! LCOV_EXCL_LINE
616 , strc(SK_" -.1d-123987548756 ") & ! LCOV_EXCL_LINE
617 , strc(SK_" 123.e1") & ! LCOV_EXCL_LINE
618 , strc(SK_" 123.D1 ") & ! LCOV_EXCL_LINE
619 , strc(SK_" 123.D-1") & ! LCOV_EXCL_LINE
620 , strc(SK_" 123.D+1") & ! LCOV_EXCL_LINE
621 , strc(SK_"-123.D+1 ") & ! LCOV_EXCL_LINE
622 , strc(SK_"+123.D+1 ") & ! LCOV_EXCL_LINE
623 , strc(SK_" +123.D+1") & ! LCOV_EXCL_LINE
624 , strc(SK_" +123.e+12456 ") & ! LCOV_EXCL_LINE
625 , strc(SK_" +123.E+12456 ") & ! LCOV_EXCL_LINE
626 , strc(SK_" +123.d+12456 ") & ! LCOV_EXCL_LINE
627 , strc(SK_" +123.D+12456 ") & ! LCOV_EXCL_LINE
628 , strc(SK_" +.1e-12456 ") & ! LCOV_EXCL_LINE
629 , strc(SK_" +.12456 ") & ! LCOV_EXCL_LINE
630 ]
631 NonRealSet= [ strc(SK_" -.1.d-123987548756 ") & ! LCOV_EXCL_LINE
632 , strc(SK_" ") & ! LCOV_EXCL_LINE
633 , strc(SK_"") & ! LCOV_EXCL_LINE
634 , strc(SK_".123.") & ! LCOV_EXCL_LINE
635 , strc(SK_"123 .") & ! LCOV_EXCL_LINE
636 , strc(SK_" 123.+1") & ! LCOV_EXCL_LINE
637 , strc(SK_" 123.D 1") & ! LCOV_EXCL_LINE
638 , strc(SK_" 123.D +1") & ! LCOV_EXCL_LINE
639 , strc(SK_" 123.D + 1") & ! LCOV_EXCL_LINE
640 , strc(SK_" 123.D+ 1") & ! LCOV_EXCL_LINE
641 , strc(SK_" 123. D+ 1") & ! LCOV_EXCL_LINE
642 , strc(SK_" + 123.D+1") & ! LCOV_EXCL_LINE
643 , strc(SK_" +123.D+-12456 ") & ! LCOV_EXCL_LINE
644 , strc(SK_" +123.D+.12456 ") & ! LCOV_EXCL_LINE
645 , strc(SK_" +.d+12456") & ! LCOV_EXCL_LINE
646 , strc(SK_" -.1.d-123987548756 ") & ! LCOV_EXCL_LINE
647 , strc(SK_" +.e-12456 ") & ! LCOV_EXCL_LINE
648 , strc(SK_"+ . ") & ! LCOV_EXCL_LINE
649 , strc(SK_"+. ") & ! LCOV_EXCL_LINE
650 , strc(SK_"+ .") & ! LCOV_EXCL_LINE
651 ]
652 end subroutine
653
654!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
655
656 subroutine setTest()
657
658 implicit none
659
660 call setData()
662 call test%run(test_isStrReal_1, SK_"test_isStrReal_1")
663 call test%run(test_isStrAlpha_1, SK_"test_isStrAlpha_1")
664 call test%run(test_isCharDigit_1, SK_"test_isCharDigit_1")
665 call test%run(test_isStrNumber_1, SK_"test_isStrNumber_1")
666 call test%run(test_isStrDigitAll_1, SK_"test_isStrDigitAll_1")
667 call test%run(test_isStrInteger_1, SK_"test_isStrInteger_1")
668 call test%run(test_isStrComplex_1, SK_"test_isStrComplex_1")
669 call test%run(test_isStrAlphaNumAll_1, SK_"test_isStrAlphaNumAll_1")
670 call test%run(test_isCharLower_1, SK_"test_isCharLower_1")
671 call test%run(test_isCharUpper_1, SK_"test_isCharUpper_1")
672 call test%run(test_getLocSpace_1, SK_"test_getLocSpace_1")
673 call test%run(test_isStrLowerAll_1, SK_"test_isStrLowerAll_1")
674 call test%run(test_isStrUpperAll_1, SK_"test_isStrUpperAll_1")
675 call test%run(test_getStrLower_1, SK_"test_getStrLower_1")
676 call test%run(test_getStrUpper_1, SK_"test_getStrUpper_1")
677 call test%run(test_setStrLower_1, SK_"test_setStrLower_1")
678 call test%run(test_setStrUpper_1, SK_"test_setStrUpper_1")
679! call test%run(test_setStrAlphaRand_1, SK_"test_setStrAlphaRand_1")
680! call test%run(test_setStrAlphaRandLower_1, SK_"test_setStrAlphaRandLower_1")
681! call test%run(test_setStrAlphaRandUpper_1, SK_"test_setStrAlphaRandUpper_1")
682
683 call test%summarize()
684
685 end subroutine setTest
686
687!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
688
689end module test_pm_strASCII ! LCOV_EXCL_LINE
Generate and return a scalar or a contiguous array of rank 1 of length s1 of randomly uniformly distr...
Return a uniform random scalar or contiguous array of arbitrary rank of randomly uniformly distribute...
Generate and return the location of the first occurrence of the whitespace character in the input str...
Generate and return the input string where the uppercase English alphabets are all converted to lower...
Generate and return the input string where the lowercase English alphabets are all converted to upper...
Generate and return .true. if the input character of length 1 is a digit as in DIGIT_VEC_SK.
Generate and return .true. if the input single character contains an lowercase English alphabet ALPHA...
Generate and return .true. if the input single character contains an uppercase English alphabet ALPHA...
Generate and return .true. if the input string is all alphanumeric, containing only digits or the Eng...
Generate and return a logical vector whose elements are .true. if and only if the corresponding chara...
Generate and return .true. if all characters of the input string collectively represent a complex num...
Generate and return .true. if all characters of the input string are numeric (digits as in DIGIT_VEC_...
Generate and return .true. if all characters of the input string collectively represent an integer.
Generate and return .true. if the input string contains only lowercase English alphabets ALPHA_LOWER_...
Generate and return .true. if the input string collectively represents an integer,...
Generate and return .true. if all characters of the input string collectively represent a real number...
Generate and return .true. if the input string contains only uppercase English alphabets ALPHA_UPPER_...
Replace all uppercase English alphabets in the input string with the corresponding lowercase English ...
Replace all lowercase English alphabets in the input string with the corresponding uppercase English ...
Generate and return the conversion of the input value to an output Fortran string,...
Definition: pm_val2str.F90:167
This module contains the derived types for generating allocatable containers of scalar,...
This module contains classes and procedures for computing various statistical quantities related to t...
character(*, SK), parameter MODULE_NAME
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
Definition: pm_kind.F90:541
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
Definition: pm_kind.F90:540
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
Definition: pm_kind.F90:539
This module contains the uncommon and hardly representable ASCII characters as well as procedures for...
Definition: pm_strASCII.F90:61
character(1, SK), dimension(*), parameter ALPHA_UPPER_VEC_SK
The constant array of type character of default kind SK containing the uppercase English letters.
character(1, SK), dimension(*), parameter ALPHA_LOWER_VEC_SK
The constant array of type character of default kind SK containing the lowercase English letters.
character(1, SK), dimension(*), parameter ALPHA_VEC_SK
The constant array of type character of default kind SK containing the ASCII uppercase and lowercase ...
character(*, SK), parameter MODULE_NAME
Definition: pm_strASCII.F90:71
character(1, SK), dimension(*), parameter ALPHANUM_VEC_SK
The constant array of type character of default kind SK containing the English numbers and alphabets.
This module contains a simple unit-testing framework for the Fortran libraries, including the ParaMon...
Definition: pm_test.F90:42
This module contains the generic procedures for converting values of different types and kinds to For...
Definition: pm_val2str.F90:58
This module contains tests of the module pm_strASCII.
logical(LK) function test_isStrInteger_1()
type(strc), dimension(:), allocatable NonRealSet
logical(LK) function test_isStrComplex_1()
type(strc), dimension(:), allocatable RealSet
logical(LK) function test_setStrLower_1()
logical(LK) function test_isCharDigit_1()
logical(LK) function test_getStrLower_1()
character(:, SK) function, allocatable getNonRealStr()
This is a helper function for generating invalid real values in string format, used to verify the fun...
logical(LK) function test_getStrUpper_1()
character(:, SK) function, allocatable getNonComplexStr()
This is a helper function for generating invalid complex values in string format, used to verify the ...
character(:, SK) function, allocatable getComplexStr(lp, rp, sep)
This is a helper function for generating valid complex values in string format, used to verify the fu...
type(strc), dimension(:), allocatable IntSet
subroutine setData()
Define the global testing data.
type(test_type) test
logical(LK) function test_isStrReal_1()
logical(LK) function test_getLocSpace_1()
logical(LK) function test_isStrNumber_1()
logical(LK) function test_isStrUpperAll_1()
logical(LK) function test_isStrLowerAll_1()
logical(LK) function test_setStrUpper_1()
logical(LK) function test_isCharUpper_1()
logical(LK) function test_isStrAlphaNumAll_1()
character(:, SK) function, allocatable getRealStr()
This is a helper function for generating valid real values in string format, used to verify the funct...
logical(LK) function test_isStrDigitAll_1()
logical(LK) function test_isStrAlpha_1()
type(strc), dimension(:), allocatable NonIntSet
logical(LK) function test_isCharLower_1()
This is the css_pdt parameterized type for generating instances of container of scalar of string obje...
This is the derived type test_type for generating objects that facilitate testing of a series of proc...
Definition: pm_test.F90:209