Skip to content

Commit 4a656f9

Browse files
committed
expanded unit test for CDK characters.
1 parent a3c43f7 commit 4a656f9

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

src/tests/jf_test_37.F90

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
module jf_test_37_mod
88

9-
use json_module, CK => json_CK
9+
use json_module, CK => json_CK, CDK => json_CDK
1010
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit
1111

1212
implicit none
@@ -64,6 +64,38 @@ subroutine test_37(error_cnt)
6464
call check_for_error()
6565
call f%destroy()
6666

67+
# ifdef USE_UCS4
68+
69+
! also test default character kind when unicode is enabled:
70+
71+
call json%parse(p, CDK_'{"a": ["1", "2", "3"]}')
72+
f = json_file(p,no_whitespace=.true.)
73+
call f%print_file(error_unit)
74+
write(error_unit,'(A)') ''
75+
call check_for_error()
76+
call f%destroy()
77+
78+
call json%parse(p, CDK_'{"b": ["4", "5", "6"]}')
79+
f = json_file(p,json)
80+
call f%print_file(error_unit)
81+
write(error_unit,'(A)') ''
82+
call check_for_error()
83+
call f%destroy()
84+
85+
f = json_file(CDK_'{"x": [1,2,3]}',no_whitespace=.true.)
86+
call f%print_file(error_unit)
87+
write(error_unit,'(A)') ''
88+
call check_for_error()
89+
call f%destroy()
90+
91+
f = json_file(CDK_'{"y": [4,5,6]}',json)
92+
call f%print_file(error_unit)
93+
write(error_unit,'(A)') ''
94+
call check_for_error()
95+
call f%destroy()
96+
97+
# endif
98+
6799
if (error_cnt==0) then
68100
write(error_unit,'(A)') ''
69101
write(error_unit,'(A)') ' Success!'

0 commit comments

Comments
 (0)