extern crate geohashing; use geohashing::*; extern crate chrono; use chrono::NaiveDate; #[test] fn check_w30() { assert_eq!(get_geohash(NaiveDate::from_ymd(2008, 5, 26), (68.0, -30.0)).unwrap(), (68.6731281043187, -30.607308006770367)); assert_eq!(get_geohash(NaiveDate::from_ymd(2008, 5, 26), (68.0, -29.0)).unwrap(), (68.6731281043187, -29.607308006770367)); assert_eq!(get_geohash(NaiveDate::from_ymd(2008, 5, 27), (68.0, -30.0)).unwrap(), (68.20967755786283, -30.10144168461238)); assert_eq!(get_geohash(NaiveDate::from_ymd(2008, 5, 27), (68.0, -29.0)).unwrap(), (68.12536718896776, -29.57711091539716)); assert_eq!(get_globalhash(NaiveDate::from_ymd(2008, 5, 26)).unwrap(), (31.163058777367056, 38.63088243733188)); assert_eq!(get_globalhash(NaiveDate::from_ymd(2008, 5, 27)).unwrap(), (-67.43390598580484, 27.75992954297726)); } #[test] fn scientific_notation_bug() { assert_eq!(get_geohash(NaiveDate::from_ymd(2012, 2, 26), (68.0, -29.0)).unwrap(), (68.00004663046163, -29.483718661102913)); }