mirror of
https://github.com/storytold/cadcraft.git
synced 2026-10-24 02:46:51 -06:00
Found while testing crates/engine/src/units.rs:279-294 (bearing, via parse_dms 297-317) Co-authored-by: Claude Haiku 5.5 <noreply@anthropic.com>
12 lines
305 B
Rust
12 lines
305 B
Rust
use cadcraft_engine::units::parse_angle;
|
|
|
|
#[test]
|
|
fn bearing_rejects_out_of_range_angles() {
|
|
for s in ["n100e", "n-45e", "n91e", "s-1w", "n-0.5e"] {
|
|
assert_eq!(parse_angle(s), None, "{s}");
|
|
}
|
|
for s in ["n0e", "n90e", "s45w"] {
|
|
assert!(parse_angle(s).is_some(), "{s}");
|
|
}
|
|
}
|