Skip to content

Commit 46dfee4

Browse files
committed
updated show method + test
1 parent 17bb315 commit 46dfee4

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/transforms/resampler.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,5 @@ end
8787
function Base.show(io::IO, s::SpectrumResampler)
8888
println(io, "SpectrumResampler($(eltype(wave(s))), $(eltype(flux(s))))")
8989
println(io, " spec: ", spectrum(s))
90-
print(io, " interpolator: ", s.interp)
90+
print(io, " interpolator: ", typeof(s.interp))
9191
end

test/transforms/resample.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ end
4646
spec = mock_spectrum()
4747
new_wave = range(minimum(spec.wave), maximum(spec.wave); length = Integer(length(spec.wave) ÷ 2.4))
4848
res_spec = resample(spec, new_wave)
49+
expected = """
50+
SpectrumResampler(Float64, Measurements.Measurement{Float64})
51+
spec: Spectrum(Float64, Measurements.Measurement{Float64})
52+
name: Test Spectrum
53+
interpolator: DataInterpolations.LinearInterpolation{Vector{Measurements.Measurement{Float64}}, Vector{Float64}, Vector{Measurements.Measurement{Float64}}, Vector{Measurements.Measurement{Float64}}, Measurements.Measurement{Float64}}"""
4954

55+
@test sprint(show, res_spec) == expected
5056
@test Spectra.wave(res_spec) == new_wave
5157
@test length(Spectra.flux(res_spec)) == length(new_wave)
5258

0 commit comments

Comments
 (0)