Skip to content

Commit 96ed571

Browse files
committed
add tests for broadcasting
1 parent a96cdcd commit 96ed571

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/test_unit.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,9 @@ end
432432
lambda = 1.0)))
433433
@test isapprox(disp_rel(equations, k), frequencies[i])
434434
@test isapprox(wave_speed(disp_rel, equations, k), wave_speeds[i])
435+
# Add test for correct broadcasting
436+
@test isapprox(disp_rel.(equations, [k, k]), [frequencies[i], frequencies[i]])
437+
@test isapprox(wave_speed.(disp_rel, equations, [k, k]), [wave_speeds[i], wave_speeds[i]])
435438
# For the normalized wave speed we expect c(0) = 1. Use eps() to avoid division by zero in c = omega / k
436439
@test isapprox(wave_speed(disp_rel, equations, eps(), normalize = true), 1.0)
437440
end

0 commit comments

Comments
 (0)