@@ -77,6 +77,21 @@ subroutine test_19(error_cnt)
77
77
end if
78
78
end if
79
79
80
+ ! now test with a variable that is NOT a matrix:
81
+ call json% get(p,' matrix(1)' ,p_matrix)
82
+ call json% matrix_info(p_matrix,is_matrix,var_type,n_sets,set_size,name)
83
+ if (json% failed()) then
84
+ call json% print_error_message(error_unit)
85
+ error_cnt = error_cnt + 1
86
+ else
87
+ if (.not. is_matrix) then
88
+ write (error_unit,' (A)' ) ' ...success'
89
+ else
90
+ write (error_unit,' (A)' ) ' Error: this should not be a matrix:'
91
+ error_cnt = error_cnt + 1
92
+ end if
93
+ end if
94
+
80
95
! now, test by path:
81
96
call json% matrix_info(p,' matrix' ,is_matrix,&
82
97
var_type= var_type,n_sets= n_sets,&
@@ -114,6 +129,17 @@ subroutine test_19(error_cnt)
114
129
error_cnt = error_cnt + 1
115
130
end if
116
131
132
+ ! now test with a variable that is NOT a matrix:
133
+ call json% matrix_info(p,' matrix(1)' ,is_matrix,found= found,&
134
+ var_type= var_type,n_sets= n_sets,&
135
+ set_size= set_size,name= name)
136
+ if (.not. is_matrix) then
137
+ write (error_unit,' (A)' ) ' ...success'
138
+ else
139
+ write (error_unit,' (A)' ) ' Error: this should not be a matrix:'
140
+ error_cnt = error_cnt + 1
141
+ end if
142
+
117
143
! cleanup:
118
144
call json% destroy(p)
119
145
0 commit comments