Skip to content

Commit 10b7260

Browse files
committed
fix test case coords
A test case using GCJ-02 coords and got the wrong result. Convert it back to WGS-84 to get correct timezone.
1 parent c853299 commit 10b7260

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/default.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@ mod tests {
1818
assert_eq!(finder.get_tz_name(-73.7729, 38.3530), "Etc/GMT+5");
1919
assert_eq!(finder.get_tz_name(114.1594, 22.3173), "Asia/Hong_Kong");
2020

21-
// Shenzhen actually, but we used a simplified polygon data.
22-
assert_eq!(finder.get_tz_name(114.0668, 22.5153), "Asia/Hong_Kong");
21+
// Original GCJ-02 coordinates: [114.0668, 22.5153], which is in Shenzhen, China,
22+
// and very close to the border with Hong Kong.
23+
// Revert it to WGS-84 coordinates to get the correct timezone.
24+
//
25+
// AMAP link: https://surl.amap.com/uJcx40w1e6bd
26+
assert_eq!(finder.get_tz_name(114.0617, 22.5180), "Asia/Shanghai");
2327

2428
assert_eq!(
2529
finder.get_tz_name(12.452_899_553_691_935, 41.903_699_636_969_634),

0 commit comments

Comments
 (0)