Skip to content

Commit

Permalink
remove repetition in testing code
Browse files Browse the repository at this point in the history
  • Loading branch information
hollandjg committed Oct 24, 2024
1 parent 0ca3c59 commit 8dc5597
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions test/test-regionprops-labeled.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@

@info "testing props with label"
props_with_label = DataFrame(label=Int[], min_row=Int[], min_col=Int[], max_row=Int[], max_col=Int[])
push!(props_with_label, (1, 1, 1, 4, 4))
push!(props_with_label, (2, 1, 4, 5, 8))
push!(props_with_label, (3, 1, 8, 6, 13))
push!(props_with_label, (4, 5, 1, 10, 7))
push!(props_with_label, (5, 5, 1, 10, 7))
push!(props_with_label,
(1, 1, 1, 4, 4),
(2, 1, 4, 5, 8),
(3, 1, 8, 6, 13),
(4, 5, 1, 10, 7),
(5, 5, 1, 10, 7)
)


@test cropfloe(img1, props_with_label, 1) == [
Expand Down Expand Up @@ -78,11 +80,13 @@

@info "testing props without label"
props_without_label = DataFrame(min_row=Int[], min_col=Int[], max_row=Int[], max_col=Int[])
push!(props_without_label, (1, 1, 4, 4))
push!(props_without_label, (1, 4, 5, 8))
push!(props_without_label, (1, 8, 6, 13))
push!(props_without_label, (5, 1, 10, 7))
push!(props_without_label, (5, 1, 10, 7))
push!(props_without_label,
(1, 1, 4, 4),
(1, 4, 5, 8),
(1, 8, 6, 13),
(5, 1, 10, 7),
(5, 1, 10, 7)
)

@test cropfloe(img1, props_without_label, 1) == [
0 0 0 0
Expand Down

0 comments on commit 8dc5597

Please sign in to comment.