add CHANGELOG and withinnmof test

This commit is contained in:
2026-06-26 23:03:49 -04:00
parent 26d7a2c0b7
commit 4e683e31bd
2 changed files with 40 additions and 2 deletions
+22 -2
View File
@@ -5,7 +5,25 @@ All notable changes to this project are documented here.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased] ## [0.3.2] - 2026-06-26
- `WithinNMOf` aircraft filter for distance from an arbitrary point.
- Add test for WithinNMOf
## [0.3.1] - 2026-06-26
### Added
- `WithPosition` aircraft filter to keep only aircraft reporting a lat/lon.
## [0.3.0] - 2026-06-26
### Added
- Client retry configuration with exponential backoff (`RetryConfig`,
`WithRetry`). Retries transport errors and 5xx responses; never retries 4xx or
context cancellation.
- String-typed enums for readsb message type and emitter category.
## [0.2.1] - 2026-06-23 ## [0.2.1] - 2026-06-23
@@ -38,7 +56,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
the `pkg/client` HTTP client with one-shot queries and channel/iterator the `pkg/client` HTTP client with one-shot queries and channel/iterator
polling for every endpoint, the `cmd/wingbits` CLI, and a README. polling for every endpoint, the `cmd/wingbits` CLI, and a README.
[Unreleased]: https://gitea.libretechconsulting.com/rmcguire/wingbits/compare/v0.2.1...HEAD [Unreleased]: https://gitea.libretechconsulting.com/rmcguire/wingbits/compare/v0.3.1...HEAD
[0.3.1]: https://gitea.libretechconsulting.com/rmcguire/wingbits/compare/v0.3.0...v0.3.1
[0.3.0]: https://gitea.libretechconsulting.com/rmcguire/wingbits/compare/v0.2.1...v0.3.0
[0.2.1]: https://gitea.libretechconsulting.com/rmcguire/wingbits/compare/v0.2.0...v0.2.1 [0.2.1]: https://gitea.libretechconsulting.com/rmcguire/wingbits/compare/v0.2.0...v0.2.1
[0.2.0]: https://gitea.libretechconsulting.com/rmcguire/wingbits/compare/v0.1.1...v0.2.0 [0.2.0]: https://gitea.libretechconsulting.com/rmcguire/wingbits/compare/v0.1.1...v0.2.0
[0.1.1]: https://gitea.libretechconsulting.com/rmcguire/wingbits/compare/v0.1.0...v0.1.1 [0.1.1]: https://gitea.libretechconsulting.com/rmcguire/wingbits/compare/v0.1.0...v0.1.1
+18
View File
@@ -113,6 +113,24 @@ func TestWithinNMOf(t *testing.T) {
} }
} }
func TestAnyOR(t *testing.T) {
// Two non-overlapping 5 nm circles; Any should keep aircraft in either.
r := &AircraftReport{Aircraft: []Aircraft{
{Hex: "nearA", Lat: 40.01, Lon: -75.0},
{Hex: "nearB", Lat: 41.0, Lon: -76.01},
{Hex: "between", Lat: 40.5, Lon: -75.5},
{Hex: "nopos"},
}}
near := r.Filter(Any(WithinNMOf(40, -75, 5), WithinNMOf(41, -76, 5)))
got := map[string]bool{}
for _, a := range near {
got[a.Hex] = true
}
if !got["nearA"] || !got["nearB"] || got["between"] || got["nopos"] || len(got) != 2 {
t.Errorf("Any(WithinNMOf...) OR mismatch, matched: %v", got)
}
}
func TestAltBaroGround(t *testing.T) { func TestAltBaroGround(t *testing.T) {
var a AltBaro var a AltBaro
if err := json.Unmarshal([]byte(`"ground"`), &a); err != nil { if err := json.Unmarshal([]byte(`"ground"`), &a); err != nil {