57 lines
1.3 KiB
Rust
57 lines
1.3 KiB
Rust
#![no_std]
|
|
#![no_main]
|
|
|
|
use wspr_beacon as _; // memory layout + panic handler
|
|
|
|
// See https://crates.io/crates/defmt-test/0.1.0 for more documentation (e.g. about the 'state'
|
|
// feature)
|
|
#[defmt_test::tests]
|
|
mod tests {
|
|
use arrayvec::ArrayString;
|
|
use defmt::{assert, assert_eq};
|
|
use wspr_beacon::loc;
|
|
|
|
#[test]
|
|
fn test_locations() {
|
|
assert_eq!(
|
|
loc::locator_from_coordinates(49.4395, 7.7635).as_str(),
|
|
"JN39vk"
|
|
);
|
|
|
|
assert_eq!(
|
|
loc::locator_from_coordinates(74.998306, 148.833363).as_str(),
|
|
"QQ44kx"
|
|
);
|
|
|
|
assert_eq!(
|
|
loc::locator_from_coordinates(64.701746, -18.640812).as_str(),
|
|
"IP04qq"
|
|
);
|
|
|
|
assert_eq!(
|
|
loc::locator_from_coordinates(19.251825, -81.541811).as_str(),
|
|
"EK99fg"
|
|
);
|
|
|
|
assert_eq!(
|
|
loc::locator_from_coordinates(-23.587708, 45.25882).as_str(),
|
|
"LG26pj"
|
|
);
|
|
|
|
assert_eq!(
|
|
loc::locator_from_coordinates(-77.566746, 167.875652).as_str(),
|
|
"RB32wk"
|
|
);
|
|
|
|
assert_eq!(
|
|
loc::locator_from_coordinates(-17.632622, -149.472404).as_str(),
|
|
"BH52gi"
|
|
);
|
|
|
|
assert_eq!(
|
|
loc::locator_from_coordinates(-19.77516, -43.959542).as_str(),
|
|
"GH80af"
|
|
);
|
|
}
|
|
}
|