Skip to content

Commit 0c3d49e

Browse files
test: cover _expand_thermo_params error branch for wrong vector length
Add test asserting ArgumentError when ThermoParams vector length is neither 1 nor n_face, covering the missing codecov line in tpm_problem.jl. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d3548ad commit 0c3d49e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

test/test_problem_api.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,16 @@ Unit tests for the Problem-Solver API introduced in v0.2.0:
9292
@test state.temperature T_matrix
9393
end
9494

95+
@testset "_expand_thermo_params — wrong vector length" begin
96+
# icosahedron has 20 faces; a ThermoParams with 3 entries is neither 1 nor n_face
97+
tp_wrong = ThermoParams([0.1, 0.2, 0.3], [1000.0, 1000.0, 1000.0], [700.0, 700.0, 700.0],
98+
[0.1, 0.1, 0.1], [0.0, 0.0, 0.0], [0.9, 0.9, 0.9])
99+
@test_throws ArgumentError SingleAsteroidThermoPhysicalProblem(shape2, tp_wrong, grid_params2;
100+
with_self_shadowing = false,
101+
with_self_heating = false,
102+
)
103+
end
104+
95105
@testset "init_temperature! binary per-body" begin
96106
prob = BinaryAsteroidThermoPhysicalProblem(
97107
(shape1, shape2),

0 commit comments

Comments
 (0)