Skip to content

Commit

Permalink
Replace Formatting.jl with Format.jl in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dingraha committed Sep 3, 2024
1 parent dccf4f0 commit 13b5b5f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
FLOWMath = "6cb5d3fb-0fe8-4cc2-bd89-9fe0b19a99d3"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
Formatting = "59287772-0a20-5a39-b81b-1366585eb4c0"
Format = "1fa38f19-a742-5d3f-a2b9-30dd87b9d5f8"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
Expand Down
16 changes: 8 additions & 8 deletions test/writevtk_tests.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module WriteVTKTests

using AcousticAnalogies
using Formatting: format
using Format: format, FormatExpr
using JLD2: JLD2
using SHA: sha1
using StaticArrays: @SVector
Expand All @@ -21,7 +21,7 @@ using Test
pvd = AcousticAnalogies.to_paraview_collection(name, ses)

for i in 1:size(ses, 1)
fname = format("{}{:08d}.vtp", name, i)
fname = format(FormatExpr("{}{:08d}.vtp"), name, i)
sha_str = bytes2hex(open(sha1, fname))
sha_str_check = bytes2hex(open(sha1, joinpath("writevtk", fname)))
@test sha_str == sha_str_check
Expand Down Expand Up @@ -52,19 +52,19 @@ using Test
pvd = AcousticAnalogies.to_paraview_collection(name, (ses,); observers=obs)

for i in 1:size(ses, 1)
fname = format("{}-block1-{:08d}.vtp", name, i)
fname = format(FormatExpr("{}-block1-{:08d}.vtp"), name, i)
sha_str = bytes2hex(open(sha1, fname))
sha_str_check = bytes2hex(open(sha1, joinpath(@__DIR__, "writevtk", fname)))
@test sha_str == sha_str_check

# The source element files for this test case with observers should be the same as the case without the observers.
name2 = "cf1a"
fname2 = format("{}{:08d}.vtp", name2, i)
fname2 = format(FormatExpr("{}{:08d}.vtp"), name2, i)
sha_str_check = bytes2hex(open(sha1, joinpath(@__DIR__, "writevtk", fname)))
@test sha_str == sha_str_check

for j in 1:length(obs)
fname = format("{}-observer$(j)-{:08d}.vtu", name, i)
fname = format(FormatExpr("{}-observer$(j)-{:08d}.vtu"), name, i)
sha_str = bytes2hex(open(sha1, fname))
sha_str_check = bytes2hex(open(sha1, joinpath(@__DIR__, "writevtk", fname)))
# @test sha_str == sha_str_check
Expand Down Expand Up @@ -101,20 +101,20 @@ using Test

for i in 1:size(ses, 1)
for b in 1:length(ses_mb)
fname = format("{}-block$(b)-{:08d}.vtp", name, i)
fname = format(FormatExpr("{}-block$(b)-{:08d}.vtp"), name, i)
sha_str = bytes2hex(open(sha1, fname))
sha_str_check = bytes2hex(open(sha1, joinpath(@__DIR__, "writevtk", fname)))
@test sha_str == sha_str_check
end

for j in 1:length(obs)
fname = format("{}-observer$(j)-{:08d}.vtu", name, i)
fname = format(FormatExpr("{}-observer$(j)-{:08d}.vtu"), name, i)
sha_str = bytes2hex(open(sha1, fname))
sha_str_check = bytes2hex(open(sha1, joinpath(@__DIR__, "writevtk", fname)))
# @test sha_str == sha_str_check

# The observers for this case should be identical to the observers from the single-block case.
fname2 = format("cf1a_with_observers-observer$(j)-{:08d}.vtu", i)
fname2 = format(FormatExpr("cf1a_with_observers-observer$(j)-{:08d}.vtu"), i)
sha_str_check = bytes2hex(open(sha1, joinpath(@__DIR__, "writevtk", fname2)))
# @test sha_str == sha_str_check
end
Expand Down

0 comments on commit 13b5b5f

Please sign in to comment.