Skip to content

Commit

Permalink
channel_code_parts: Add extra tests for empty [X]FDSN channel codes
Browse files Browse the repository at this point in the history
Make sure that we test the path taken when a miniSEED id starts
with "XFDSN:" or "FDSN:" but is empty otherwise.
  • Loading branch information
anowacki committed Feb 26, 2024
1 parent 4cdc7d4 commit b396060
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/channel_codes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,19 @@ using Test
@test LibMseed.channel_code_parts("XFDSN:___ _ _ ") ==
(net="", sta="", loc="", cha=" ")
end

@testset "Empty after '[X]FDSN:'" begin
@test (
@test_logs (
:warn, "unexpectedly short channel id"
) LibMseed.channel_code_parts("XFDSN:")
) == (net="", sta="XFDSN:", loc="", cha="")
@test (
@test_logs (
:warn, "unexpectedly short channel id"
) LibMseed.channel_code_parts("FDSN:")
) == (net="", sta="FDSN:", loc="", cha="")
end
end

@testset "_ separated" begin
Expand Down

0 comments on commit b396060

Please sign in to comment.