Skip to content

Commit

Permalink
Add tests for ==
Browse files Browse the repository at this point in the history
  • Loading branch information
fhagemann authored and oschulz committed Jul 29, 2023
1 parent 69e3eb5 commit 27a708b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/test_detector_waveforms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,23 @@ end # testset
@test A.signal isa ArrayOfSimilarArrays
@test A.signal[1] == A[1].signal
end # testset

@testset "detector_waveform equality" begin
wfdata = rand(128)
timedata = 0:0.1:12.7

wf1 = RDWaveform(wfdata, timedata)
wf2 = RDWaveform(reverse(wfdata), timedata)
wf3 = RDWaveform(deepcopy(wfdata), timedata)

@test wf1 != wf2
@test wf1 == wf3

A = ArrayOfRDWaveforms([wf1, wf2])
B = ArrayOfRDWaveforms([wf1, wf3])
C = ArrayOfRDWaveforms([wf3, wf2])

@test A != B
@test A == C
end

0 comments on commit 27a708b

Please sign in to comment.