Пример #1
0
func (s *S) TestEncodeCoordinates(c *C) {
	var tweet ts.Tweet
	tweet.Coordinates = &ts.Point{ts.Latitude(10.1), ts.Longitude(-12.5)}
	data := decodeJson(marshal(tweet))
	coords := data["coordinates"].(map[string]interface{})
	points := coords["coordinates"].([]interface{})
	c.Assert(points[0], Equals, -12.5)
	c.Assert(points[1], Equals, 10.1)
}