@@ -251,49 +251,47 @@ close(g)
251
251
close (fid)
252
252
253
253
# more do syntax: atomic rename version
254
- if VERSION >= v " 0.4"
255
- tmpdir = mktempdir ()
256
- outfile = joinpath (tmpdir, " test.h5" )
254
+ tmpdir = mktempdir ()
255
+ outfile = joinpath (tmpdir, " test.h5" )
257
256
258
- # create a new file
259
- h5rewrite (outfile) do fid
260
- g_create (fid, " mygroup" ) do g
261
- write (g, " x" , 3.3 )
262
- end
263
- end
264
- @test length (readdir (tmpdir)) == 1
265
- h5open (outfile, " r" ) do fid
266
- @test names (fid) == Compat. ASCIIString[" mygroup" ]
267
- @test names (fid[" mygroup" ]) == Compat. ASCIIString[" x" ]
257
+ # create a new file
258
+ h5rewrite (outfile) do fid
259
+ g_create (fid, " mygroup" ) do g
260
+ write (g, " x" , 3.3 )
268
261
end
262
+ end
263
+ @test length (readdir (tmpdir)) == 1
264
+ h5open (outfile, " r" ) do fid
265
+ @test names (fid) == Compat. ASCIIString[" mygroup" ]
266
+ @test names (fid[" mygroup" ]) == Compat. ASCIIString[" x" ]
267
+ end
269
268
270
- # fail to overwrite
271
- @test_throws ErrorException h5rewrite (outfile) do fid
272
- g_create (fid, " mygroup" ) do g
273
- write (g, " oops" , 3.3 )
274
- end
275
- error (" failed" )
276
- end
277
- @test length (readdir (tmpdir)) == 1
278
- h5open (outfile, " r" ) do fid
279
- @test names (fid) == Compat. ASCIIString[" mygroup" ]
280
- @test names (fid[" mygroup" ]) == Compat. ASCIIString[" x" ]
269
+ # fail to overwrite
270
+ @test_throws ErrorException h5rewrite (outfile) do fid
271
+ g_create (fid, " mygroup" ) do g
272
+ write (g, " oops" , 3.3 )
281
273
end
274
+ error (" failed" )
275
+ end
276
+ @test length (readdir (tmpdir)) == 1
277
+ h5open (outfile, " r" ) do fid
278
+ @test names (fid) == Compat. ASCIIString[" mygroup" ]
279
+ @test names (fid[" mygroup" ]) == Compat. ASCIIString[" x" ]
280
+ end
282
281
283
- # overwrite
284
- h5rewrite (outfile) do fid
285
- g_create (fid, " mygroup" ) do g
286
- write (g, " y" , 3.3 )
287
- end
288
- end
289
- @test length (readdir (tmpdir)) == 1
290
- h5open (outfile, " r" ) do fid
291
- @test names (fid) == Compat. ASCIIString[" mygroup" ]
292
- @test names (fid[" mygroup" ]) == Compat. ASCIIString[" y" ]
282
+ # overwrite
283
+ h5rewrite (outfile) do fid
284
+ g_create (fid, " mygroup" ) do g
285
+ write (g, " y" , 3.3 )
293
286
end
294
-
295
- rm (tmpdir, recursive= true )
296
287
end
288
+ @test length (readdir (tmpdir)) == 1
289
+ h5open (outfile, " r" ) do fid
290
+ @test names (fid) == Compat. ASCIIString[" mygroup" ]
291
+ @test names (fid[" mygroup" ]) == Compat. ASCIIString[" y" ]
292
+ end
293
+
294
+ rm (tmpdir, recursive= true )
297
295
298
296
d = h5read (joinpath (test_path, " compound.h5" ), " /data" )
299
297
@assert typeof (d) == HDF5. HDF5Compound
0 commit comments