Skip to content

Commit f4a6119

Browse files
committed
Factor out empty_dir
1 parent 6077dc1 commit f4a6119

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/sys/stm_tests.ml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ struct
99
| Directory of {fs_map: filesys Map_names.t}
1010
| File
1111

12+
let empty_dir = Directory {fs_map = Map_names.empty}
13+
1214
let rec find_opt fs path =
1315
match fs with
1416
| File ->
@@ -183,7 +185,7 @@ struct
183185

184186
let sandbox_root = "_sandbox"
185187

186-
let init_state = Directory {fs_map = Map_names.empty}
188+
let init_state = Model.empty_dir
187189

188190
let path_is_a_dir fs path =
189191
match Model.find_opt fs path with
@@ -217,7 +219,7 @@ struct
217219
| Mkdir (path, new_dir_name) ->
218220
if Model.mem fs (path @ [new_dir_name])
219221
then fs
220-
else Model.insert fs path new_dir_name (Directory {fs_map = Map_names.empty})
222+
else Model.insert fs path new_dir_name Model.empty_dir
221223
| Remove (path, file_name) ->
222224
if Model.find_opt fs (path @ [file_name]) = Some File
223225
then Model.remove fs path file_name

0 commit comments

Comments
 (0)