|
1 | 1 | @testitem "BaseParams: calc_shunt_capacitance unit tests" setup = [defaults] begin |
2 | 2 | @testset "Basic Functionality" begin |
3 | 3 | # Example from docstring |
4 | | - radius_in = 0.01 |
| 4 | + r_in = 0.01 |
5 | 5 | r_ex = 0.02 |
6 | 6 | epsr = 2.3 |
7 | | - cap = calc_shunt_capacitance(radius_in, r_ex, epsr) |
| 7 | + cap = calc_shunt_capacitance(r_in, r_ex, epsr) |
8 | 8 | @test isapprox(cap, 1.241e-10, atol = TEST_TOL) |
9 | 9 | # Vacuum (epsr = 1) |
10 | 10 | cap_vac = calc_shunt_capacitance(0.01, 0.02, 1.0) |
11 | 11 | @test cap_vac < cap |
12 | 12 | end |
13 | 13 |
|
14 | 14 | @testset "Edge Cases" begin |
15 | | - # Collapsing geometry: radius_in -> r_ex |
| 15 | + # Collapsing geometry: r_in -> r_ex |
16 | 16 | cap = calc_shunt_capacitance(0.02, 0.02, 2.3) |
17 | 17 | @test isinf(cap) || isnan(cap) |
18 | 18 | # Very large radii |
|
43 | 43 |
|
44 | 44 | @testset "Type Stability & Promotion" begin |
45 | 45 | using Measurements |
46 | | - radius_in = 0.01 |
| 46 | + r_in = 0.01 |
47 | 47 | r_ex = 0.02 |
48 | 48 | epsr = 2.3 |
49 | | - min = measurement(radius_in, 1e-4) |
| 49 | + min = measurement(r_in, 1e-4) |
50 | 50 | mex = measurement(r_ex, 1e-4) |
51 | 51 | mepsr = measurement(epsr, 1e-2) |
52 | 52 | # All Float64 |
53 | | - res1 = calc_shunt_capacitance(radius_in, r_ex, epsr) |
| 53 | + res1 = calc_shunt_capacitance(r_in, r_ex, epsr) |
54 | 54 | @test typeof(res1) == Float64 |
55 | 55 | # All Measurement |
56 | 56 | res2 = calc_shunt_capacitance(min, mex, mepsr) |
|
59 | 59 | res3 = calc_shunt_capacitance(min, r_ex, epsr) |
60 | 60 | @test res3 isa Measurement{Float64} |
61 | 61 | # Mixed: second argument Measurement |
62 | | - res4 = calc_shunt_capacitance(radius_in, mex, epsr) |
| 62 | + res4 = calc_shunt_capacitance(r_in, mex, epsr) |
63 | 63 | @test res4 isa Measurement{Float64} |
64 | 64 | # Mixed: third argument Measurement |
65 | | - res5 = calc_shunt_capacitance(radius_in, r_ex, mepsr) |
| 65 | + res5 = calc_shunt_capacitance(r_in, r_ex, mepsr) |
66 | 66 | @test res5 isa Measurement{Float64} |
67 | 67 | end |
68 | 68 |
|
|
0 commit comments