Some checks failed
Build and Push / Build and Push Docker Image (push) Failing after 4m38s
- F-level (228): replace length/1 with Enum.count_until/2 or pattern matching; convert Enum.flat_map+if to Enum.filter+Enum.map; fix identity case in narr_client - W-level (46): normalize dual atom/string key access in weather_layers, beacon_measurements, surface, skewt_live, contact_live/show; add :data_provider and weather-map assigns to ignored_assigns in credo config (consumed by child components credo can't trace); remove weak is_list assertion; remove explicit assert_receive timeout - R-level (6): replace 'This module provides...' moduledocs with meaningful descriptions - Also fix 4 compile-connected xref issues by deferring BandConfig.band_options() from module attribute to runtime Co-Authored-By: Claude <noreply@anthropic.com>
35 lines
1.1 KiB
Elixir
35 lines
1.1 KiB
Elixir
defmodule Microwaveprop.Propagation.ModeThresholdsTest do
|
|
use ExUnit.Case, async: true
|
|
|
|
alias Microwaveprop.Propagation.ModeThresholds
|
|
|
|
describe "required_snr_db/1" do
|
|
test "returns the documented thresholds for each supported mode" do
|
|
assert ModeThresholds.required_snr_db(:ssb) == 0.0
|
|
assert ModeThresholds.required_snr_db(:cw) == -18.0
|
|
assert ModeThresholds.required_snr_db(:q65_60a) == -24.0
|
|
assert ModeThresholds.required_snr_db(:q65_120b) == -26.0
|
|
end
|
|
|
|
test "raises FunctionClauseError for unknown modes" do
|
|
assert_raise FunctionClauseError, fn -> ModeThresholds.required_snr_db(:fm) end
|
|
end
|
|
end
|
|
|
|
describe "modes/0" do
|
|
test "returns ordered {atom, label} pairs covering every threshold" do
|
|
modes = ModeThresholds.modes()
|
|
assert {:ssb, "SSB"} in modes
|
|
assert {:cw, "CW"} in modes
|
|
assert {:q65_60a, "Q65-60A"} in modes
|
|
assert {:q65_120b, "Q65-120B"} in modes
|
|
assert Enum.count_until(modes, 5) == 4
|
|
end
|
|
end
|
|
|
|
describe "default_mode/0" do
|
|
test "returns the SSB atom" do
|
|
assert ModeThresholds.default_mode() == :ssb
|
|
end
|
|
end
|
|
end
|