From 4e683e31bdacb6d66e436c6b3295543479db17fd Mon Sep 17 00:00:00 2001 From: Ryan McGuire Date: Fri, 26 Jun 2026 23:03:49 -0400 Subject: [PATCH] add CHANGELOG and withinnmof test --- CHANGELOG.md | 24 ++++++++++++++++++++++-- pkg/types/readsb/readsb_test.go | 18 ++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 351dd46..efc96ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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/), 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 @@ -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 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.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 diff --git a/pkg/types/readsb/readsb_test.go b/pkg/types/readsb/readsb_test.go index 9909526..e06494f 100644 --- a/pkg/types/readsb/readsb_test.go +++ b/pkg/types/readsb/readsb_test.go @@ -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) { var a AltBaro if err := json.Unmarshal([]byte(`"ground"`), &a); err != nil {