Skip to content

Commit

Permalink
fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
cecoeco committed Aug 18, 2024
1 parent 0f14664 commit 3b59182
Showing 1 changed file with 54 additions and 26 deletions.
80 changes: 54 additions & 26 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ using HTTP, PRISMA, Test
Test.@testset "checklist_df" begin
df::DataFrame = PRISMA.checklist_df()

PRISMA.checklist_save("checklist.csv", df, overwrite=true)
PRISMA.checklist_save("checklist.csv", df)
Test.@test Base.Filesystem.isfile("checklist.csv")
Test.@test PRISMA.checklist_read("checklist.csv") == df
Test.@test isa(PRISMA.checklist_read("checklist.csv"), DataFrame)

PRISMA.checklist_save("checklist.xlsx", df, overwrite=true)
PRISMA.checklist_save("checklist.xlsx", df)
Test.@test Base.Filesystem.isfile("checklist.xlsx")
Test.@test PRISMA.checklist_read("checklist.xlsx") == df
Test.@test isa(PRISMA.checklist_read("checklist.xlsx"), DataFrame)

PRISMA.checklist_save("checklist.html", df, overwrite=true)
PRISMA.checklist_save("checklist.html", df)
Test.@test Base.Filesystem.isfile("checklist.html")
Test.@test PRISMA.checklist_read("checklist.html") == df
Test.@test isa(PRISMA.checklist_read("checklist.html"), DataFrame)

PRISMA.checklist_save("checklist.json", df, overwrite=true)
PRISMA.checklist_save("checklist.json", df)
Test.@test Base.Filesystem.isfile("checklist.json")
Test.@test PRISMA.checklist_read("checklist.json") == df
Test.@test isa(PRISMA.checklist_read("checklist.json"), DataFrame)

# remove the files
Base.Filesystem.rm("checklist.csv")
Expand All @@ -33,17 +33,21 @@ Test.@testset "checklist" begin
cl::PRISMA.Checklist = PRISMA.checklist(pdf)
PRISMA.checklist_save("checklist.csv", cl, overwrite=true)
PRISMA.checklist_save("checklist.csv", cl)
Test.@test Base.Filesystem.isfile("checklist.csv")
Test.@test isa(PRISMA.checklist_read("checklist.csv"), DataFrame)
PRISMA.checklist_save("checklist.xlsx", cl, overwrite=true)
PRISMA.checklist_save("checklist.xlsx", cl)
Test.@test Base.Filesystem.isfile("checklist.xlsx")
Test.@test isa(PRISMA.checklist_read("checklist.xlsx"), DataFrame)
PRISMA.checklist_save("checklist.html", cl, overwrite=true)
PRISMA.checklist_save("checklist.html", cl)
Test.@test Base.Filesystem.isfile("checklist.html")
Test.@test isa(PRISMA.checklist_read("checklist.html"), DataFrame)
PRISMA.checklist_save("checklist.json", cl, overwrite=true)
PRISMA.checklist_save("checklist.json", cl)
Test.@test Base.Filesystem.isfile("checklist.json")
Test.@test isa(PRISMA.checklist_read("checklist.json"), DataFrame)
# remove the files
Base.Filesystem.rm("checklist.csv")
Expand All @@ -55,21 +59,21 @@ end
Test.@testset "flow_diagram_df" begin
df::DataFrame = PRISMA.flow_diagram_df()

PRISMA.flow_diagram_save("flow_diagram.csv", df, overwrite=true)
PRISMA.flow_diagram_save("flow_diagram.csv", df)
Test.@test Base.Filesystem.isfile("flow_diagram.csv")
Test.@test PRISMA.flow_diagram_read("flow_diagram.csv") == df
Test.@test isa(PRISMA.flow_diagram_read("flow_diagram.csv"), DataFrame)

PRISMA.flow_diagram_save("flow_diagram.xlsx", df, overwrite=true)
PRISMA.flow_diagram_save("flow_diagram.xlsx", df)
Test.@test Base.Filesystem.isfile("flow_diagram.xlsx")
Test.@test PRISMA.flow_diagram_read("flow_diagram.xlsx") == df
Test.@test isa(PRISMA.flow_diagram_read("flow_diagram.xlsx"), DataFrame)

PRISMA.flow_diagram_save("flow_diagram.html", df, overwrite=true)
PRISMA.flow_diagram_save("flow_diagram.html", df)
Test.@test Base.Filesystem.isfile("flow_diagram.html")
Test.@test PRISMA.flow_diagram_read("flow_diagram.html") == df
Test.@test isa(PRISMA.flow_diagram_read("flow_diagram.html"), DataFrame)

PRISMA.flow_diagram_save("flow_diagram.json", df, overwrite=true)
PRISMA.flow_diagram_save("flow_diagram.json", df)
Test.@test Base.Filesystem.isfile("flow_diagram.json")
Test.@test PRISMA.flow_diagram_read("flow_diagram.json") == df
Test.@test isa(PRISMA.flow_diagram_read("flow_diagram.json"), DataFrame)

# remove the files
Base.Filesystem.rm("flow_diagram.csv")
Expand All @@ -79,18 +83,42 @@ Test.@testset "flow_diagram_df" begin
end

Test.@testset "flow_diagram" begin
fd::PRISMA.FlowDiagram = PRISMA.flow_diagram()

PRISMA.flow_diagram_save("flow_diagram.svg", fd, overwrite=true)
fd::PRISMA.FlowDiagram = PRISMA.flow_diagram(
flow_diagram_df(),
background_color="white",
grayboxes=false,
grayboxes_color="#white",
top_boxes=true,
top_boxes_borders=true,
top_boxes_color="white",
side_boxes=true,
side_boxes_borders=true,
side_boxes_color="white",
previous_studies=true,
other_methods=true,
borders=true,
border_style="solid",
border_width=1,
border_color="black",
font="Arial",
font_color="black",
font_size=10,
arrow_head="normal",
arrow_size=1,
arrow_color="black",
arrow_width=1
)

PRISMA.flow_diagram_save("flow_diagram.svg", fd)
Test.@test Base.Filesystem.isfile("flow_diagram.svg")

PRISMA.flow_diagram_save("flow_diagram.png", fd, overwrite=true)
PRISMA.flow_diagram_save("flow_diagram.png", fd)
Test.@test Base.Filesystem.isfile("flow_diagram.png")

PRISMA.flow_diagram_save("flow_diagram.pdf", fd, overwrite=true)
PRISMA.flow_diagram_save("flow_diagram.pdf", fd)
Test.@test Base.Filesystem.isfile("flow_diagram.pdf")

PRISMA.flow_diagram_save("flow_diagram.dot", fd, overwrite=true)
PRISMA.flow_diagram_save("flow_diagram.dot", fd)
Test.@test Base.Filesystem.isfile("flow_diagram.dot")

# remove the files
Expand Down

0 comments on commit 3b59182

Please sign in to comment.