lib

Core libraries for Radroots
git clone https://radroots.dev/git/lib.git
Log | Files | Refs | README

commit 69cc1738440d615f661145f5ff821aec0dbfe4b2
parent 710fb2feaf6fc1ace7f4fe77a451e4fb6fa25e54
Author: triesap <tyson@radroots.org>
Date:   Fri, 26 Jun 2026 23:51:10 +0000

geocoder: add fixture asset feature

Diffstat:
Mcrates/geocoder/Cargo.toml | 3+++
Mcrates/geocoder/src/asset.rs | 7+++++++
2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/crates/geocoder/Cargo.toml b/crates/geocoder/Cargo.toml @@ -11,6 +11,9 @@ repository.workspace = true homepage.workspace = true readme = "README" +[features] +test-fixture-geonames-asset = [] + [dependencies] hex = { workspace = true } radroots_runtime_paths = { workspace = true } diff --git a/crates/geocoder/src/asset.rs b/crates/geocoder/src/asset.rs @@ -13,9 +13,16 @@ pub const GEONAMES_ASSET_VERSION: &str = "1.0"; pub const GEONAMES_ASSET_FILE_NAME: &str = "geonames-1.0.db"; pub const GEONAMES_ASSET_URL: &str = "https://assets.radroots.io/data/geonames/geonames-1.0.db"; pub const GEONAMES_ASSET_HOST: &str = "assets.radroots.io"; +#[cfg(not(feature = "test-fixture-geonames-asset"))] pub const GEONAMES_ASSET_BYTE_SIZE: u64 = 12_951_552; +#[cfg(feature = "test-fixture-geonames-asset")] +pub const GEONAMES_ASSET_BYTE_SIZE: u64 = 20_480; +#[cfg(not(feature = "test-fixture-geonames-asset"))] pub const GEONAMES_ASSET_SHA256: &str = "6ca5f1a324de02922d40b1ff33eedf3a5a133c978de921eee5130a0c7876079c"; +#[cfg(feature = "test-fixture-geonames-asset")] +pub const GEONAMES_ASSET_SHA256: &str = + "3f81face93a88cda0a0e0a1c3611c2280177061b1a2bbe9ced42526c762885b6"; pub const GEONAMES_1_0_ASSET: GeoNamesAssetSpec = GeoNamesAssetSpec { version: GEONAMES_ASSET_VERSION,