Skip to content

Commit f8d0697

Browse files
committed
Test remaining uncovered optional args in test 7
1 parent a1efc3e commit f8d0697

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/tests/jf_test_7.f90

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ subroutine test_7(error_cnt)
6464
integer,intent(out) :: error_cnt
6565

6666
type(json_value),pointer :: root,a,b,c,d,e,e1,e2,escaped_string
67+
logical :: found
6768

6869
error_cnt = 0
6970
call json_initialize()
@@ -249,6 +250,9 @@ subroutine test_7(error_cnt)
249250
error_cnt = error_cnt + 1
250251
end if
251252

253+
call json_add(root,'wacky string',['trim ',' and ',' adjust',' left'],&
254+
trim_str=.true.,adjustl_str=.true.)
255+
252256
nullify(a) !don't need these anymore
253257
nullify(b)
254258
nullify(c)
@@ -263,6 +267,14 @@ subroutine test_7(error_cnt)
263267
call json_print_error_message(error_unit)
264268
error_cnt = error_cnt + 1
265269
end if
270+
! look for the 'escaped string' entry
271+
call json_get(root,'escaped string',escaped_string,found)
272+
if (.not. found) then
273+
call json_print_error_message(error_unit)
274+
error_cnt = error_cnt + 1
275+
end if
276+
! remove the escaped string entry
277+
if (found) call json_remove(escaped_string,destroy=.true.)
266278
call json_print(root,error_unit) !print to stderr
267279
if (json_failed()) then
268280
call json_print_error_message(error_unit)

0 commit comments

Comments
 (0)