Skip to content

Commit 20f86ba

Browse files
author
Damian Rouson
committed
fix(test): rm associations to work around gfortran
1 parent cbbc55f commit 20f86ba

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

src/dag_s.f90

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ end function topological_sort
111111

112112
module procedure construct_from_json
113113
type(fallible_json_value_t) :: maybe_vertices
114+
type(error_list_t) errors
114115

115116
maybe_vertices = json_object%get_element("vertices")
116-
associate(errors => maybe_vertices%errors())
117-
call assert(.not. errors%has_any(), "dag_s construct_from_json: .not. errors%has_any()", char(errors%to_string()))
118-
end associate
117+
errors = maybe_vertices%errors()
118+
call assert(.not. errors%has_any(), "dag_s construct_from_json: .not. errors%has_any()", char(errors%to_string()))
119119

120120
select type (vertices => maybe_vertices%value_())
121121
type is (json_array_t)
@@ -130,20 +130,18 @@ end function topological_sort
130130
module procedure to_json
131131
type(fallible_json_string_t) maybe_key
132132
type(error_list_t) errors
133+
type(json_string_t) vertices_key
134+
type(json_array_t) vertices_value
133135

134136
maybe_key = fallible_json_string_t("vertices")
135137
errors = maybe_key%errors()
136138
call assert(.not. errors%has_any(), "dag%to_json: .not. errors%has_any()", char(errors%to_string()))
137139

138-
block
139-
type(json_array_t) vertices_value
140140

141-
vertices_value = json_array_t(json_element_t(self%vertices%to_json()))
141+
vertices_value = json_array_t(json_element_t(self%vertices%to_json()))
142142

143-
associate(vertices_key => maybe_key%string())
144-
json_object = json_object_t([vertices_key], [json_element_t(vertices_value)])
145-
end associate
146-
end block
143+
vertices_key = maybe_key%string()
144+
json_object = json_object_t([vertices_key], [json_element_t(vertices_value)])
147145
end procedure
148146

149147
module procedure num_vertices

test/dag_test.f90

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ function construct_dag_and_write_pdf() result(result_)
6666
character(len=*), parameter :: command = 'dot -Tpdf -o ' // pdf_file_name // ' ' // dot_file_name
6767
integer, parameter :: success=0
6868
integer exit_status, command_status
69+
type(dag_t) modules
6970

70-
associate(modules => module_tree_from_components())
71+
modules = module_tree_from_components()
7172
call modules%save_digraph(dot_file_name, 'RL', 300)
7273
call execute_command_line(command, wait=.true., exitstat=exit_status, cmdstat=command_status)
7374
result_ = assert_equals(success, exit_status) .and. assert_equals(success, command_status)
74-
end associate
7575

7676
end function
7777

@@ -85,11 +85,11 @@ function construct_dag_and_json_object() result(result_)
8585
'{"label":"vertex_m","edges":[]},' // &
8686
'{"label":"dag_m","edges":[3]},' // &
8787
'{"label":"dag_s","edges":[4,1]}]}'
88+
type(dag_t) dag
8889

89-
associate(dag => module_tree_from_components())
90-
json_object = dag%to_json()
91-
result_ = assert_equals(var_str(expected_json), json_object%to_compact_string())
92-
end associate
90+
dag = module_tree_from_components()
91+
json_object = dag%to_json()
92+
result_ = assert_equals(var_str(expected_json), json_object%to_compact_string())
9393

9494
end function
9595

0 commit comments

Comments
 (0)