From 734cf3f667ad497e78d7875ff47f684d1f7e49ae Mon Sep 17 00:00:00 2001 From: Patrick Peng Sun Date: Sat, 6 May 2017 18:45:14 +1000 Subject: [PATCH] location message test --- inMsg_test.go | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/inMsg_test.go b/inMsg_test.go index cad8e02..ec0a78d 100644 --- a/inMsg_test.go +++ b/inMsg_test.go @@ -211,13 +211,19 @@ func TestAcceptLocationInfo(t *testing.T) { // // Decript as: - // - // - // 1493304047 - // - // - // -33.764935 - // 150.960327 - // 110.000000 - // + msg := ` + + + 1493304047 + + + -33.764935 + 150.960327 + 110.000000 + ` + m := ReadEventMsg(msg) + AssertEqual(t, m.Event, "LOCATION", "Expect LOCATION event") + AssertEqual(t, m.Longitude, 150.960327, "Expect 150.960327") + AssertEqual(t, m.Latitude, -33.764935, "Expect -33.764935") + AssertEqual(t, m.Precision, 110.000000, "Expect 110.000000") }