Skip to content

Commit 1f554d3

Browse files
committed
Add expected output test for test 12
1 parent 54a386f commit 1f554d3

File tree

2 files changed

+99
-3
lines changed

2 files changed

+99
-3
lines changed

files/expected-outputs/test12.json

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{
2+
"array data": {
3+
"shape": [
4+
5,
5+
3,
6+
4
7+
],
8+
"total size": 60,
9+
"description": "Vector data",
10+
"data": [
11+
1.0,
12+
2.0,
13+
3.0,
14+
4.0,
15+
5.0,
16+
6.0,
17+
7.0,
18+
8.0,
19+
9.0,
20+
10.0,
21+
11.0,
22+
12.0,
23+
13.0,
24+
14.0,
25+
15.0,
26+
16.0,
27+
17.0,
28+
18.0,
29+
19.0,
30+
20.0,
31+
21.0,
32+
22.0,
33+
23.0,
34+
24.0,
35+
25.0,
36+
26.0,
37+
27.0,
38+
28.0,
39+
29.0,
40+
30.0,
41+
31.0,
42+
32.0,
43+
33.0,
44+
34.0,
45+
35.0,
46+
36.0,
47+
37.0,
48+
38.0,
49+
39.0,
50+
40.0,
51+
41.0,
52+
42.0,
53+
43.0,
54+
44.0,
55+
45.0,
56+
46.0,
57+
47.0,
58+
48.0,
59+
49.0,
60+
50.0,
61+
51.0,
62+
52.0,
63+
53.0,
64+
54.0,
65+
55.0,
66+
56.0,
67+
57.0,
68+
58.0,
69+
59.0,
70+
60.0
71+
]
72+
},
73+
"SOS": [
74+
true,
75+
true,
76+
true,
77+
false,
78+
false,
79+
false,
80+
true,
81+
true,
82+
true
83+
],
84+
"vector string": [
85+
"only one value"
86+
],
87+
"page": [
88+
"The quick brown fox",
89+
"jumps over the lazy dog."
90+
]
91+
}

src/tests/jf_test_12.f90

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ module jf_test_12_mod
55

66
implicit none
77

8-
character(len=*),parameter :: dir = '../files/outputs/' !! Path to write JSON file to
9-
character(len=*),parameter :: file = 'array.json' !! Filename to write
8+
character(len=*),parameter :: dir = '../files/' !! Path to write JSON file to
9+
character(len=*),parameter :: file = 'test12.json' !! Filename to write
1010
real(wp), parameter :: TOL = 100*epsilon(1.0_wp) !! Tolerance for real comparisons
1111

1212
contains
@@ -26,7 +26,7 @@ subroutine test_12(error_cnt)
2626
real(wp), allocatable :: fetched_array(:)
2727
character(kind=CK,len=:), allocatable :: description
2828
integer :: i,j,k !! loop indices
29-
integer :: array_length
29+
integer :: array_length, lun
3030
logical :: existed
3131
logical, allocatable :: SOS(:)
3232

@@ -156,6 +156,11 @@ subroutine test_12(error_cnt)
156156
call my_file%get(tmp_json_ptr)
157157
call check_errors(associated(tmp_json_ptr,root))
158158

159+
open(file=dir//file,newunit=lun,form='formatted',action='write')
160+
call my_file%print_file(lun)
161+
call check_errors()
162+
close(lun)
163+
159164
contains
160165
subroutine check_errors(assertion)
161166
logical, optional, intent(in) :: assertion

0 commit comments

Comments
 (0)