From 823af68923e16a478fbe614034edfd9c0f03c97f Mon Sep 17 00:00:00 2001 From: Martin Polden Date: Mon, 27 Aug 2018 21:48:08 +0200 Subject: [PATCH] Test /coordinates --- http/http.go | 2 +- http/http_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/http/http.go b/http/http.go index 7accf96..eb15bcf 100644 --- a/http/http.go +++ b/http/http.go @@ -169,7 +169,7 @@ func (s *Server) CLICoordinatesHandler(w http.ResponseWriter, r *http.Request) * if err != nil { return internalServerError(err) } - fmt.Fprintf(w, "%s, %s\n", formatCoordinate(response.Latitude), formatCoordinate(response.Longitude)) + fmt.Fprintf(w, "%s,%s\n", formatCoordinate(response.Latitude), formatCoordinate(response.Longitude)) return nil } diff --git a/http/http_test.go b/http/http_test.go index 8b6d341..6478325 100644 --- a/http/http_test.go +++ b/http/http_test.go @@ -67,6 +67,7 @@ func TestCLIHandlers(t *testing.T) { {s.URL + "/ip", "127.0.0.1\n", 200, "", ""}, {s.URL + "/country", "Elbonia\n", 200, "", ""}, {s.URL + "/country-iso", "EB\n", 200, "", ""}, + {s.URL + "/coordinates", "63.416667,10.416667\n", 200, "", ""}, {s.URL + "/city", "Bornyasherk\n", 200, "", ""}, {s.URL + "/foo", "404 page not found", 404, "", ""}, }