{"action":"created","comment":{"url":"https://api.github.com/repos/dancannon/gorethink/pulls/comments/26164272","id":26164272,"diff_hunk":"@@ -1,42 +1,89 @@\n package gorethink\n \n import (\n+\t\"reflect\"\n+\n \t\"github.com/dancannon/gorethink/types\"\n \n \ttest \"gopkg.in/check.v1\"\n )\n \n+/* BEGIN FLOAT HELPERS */\n+\n+// totally ripped off from math/all_test.go\n+// https://github.com/golang/go/blob/master/src/math/all_test.go#L1723-L1749\n+func tolerance(a, b, e float64) bool {\n+\td := a - b\n+\tif d < 0 {\n+\t\td = -d\n+\n+\t}\n+\n+\tif a != 0 {\n+\t\te = e * a\n+\t\tif e < 0 {\n+\t\t\te = -e\n+\n+\t\t}\n+\n+\t}\n+\treturn d < e\n+}\n+\n+func mehclose(a, b float64) bool    { return tolerance(a, b, 1e-2) }\n+func kindaclose(a, b float64) bool  { return tolerance(a, b, 1e-8) }\n+func prettyclose(a, b float64) bool { return tolerance(a, b, 1e-14) }\n+func veryclose(a, b float64) bool   { return tolerance(a, b, 4e-16) }\n+func soclose(a, b, e float64) bool  { return tolerance(a, b, e) }\n+\n+func compareCoordinates(co [][]float64, lines types.Lines, c *test.C) {\n+\tfor _, points := range lines {\n+\t\tfor ip, point := range points {\n+\t\t\tv := reflect.ValueOf(point)\n+\t\t\tfor i := 0; i < v.NumField(); i++ {","path":"query_geospatial_test.go","position":43,"original_position":43,"commit_id":"153cd2deb30211ffc90f56095e46e4ac24eee924","original_commit_id":"153cd2deb30211ffc90f56095e46e4ac24eee924","user":{"login":"dancannon","id":414768,"avatar_url":"https://avatars.githubusercontent.com/u/414768?v=3","gravatar_id":"","url":"https://api.github.com/users/dancannon","html_url":"https://github.com/dancannon","followers_url":"https://api.github.com/users/dancannon/followers","following_url":"https://api.github.com/users/dancannon/following{/other_user}","gists_url":"https://api.github.com/users/dancannon/gists{/gist_id}","starred_url":"https://api.github.com/users/dancannon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dancannon/subscriptions","organizations_url":"https://api.github.com/users/dancannon/orgs","repos_url":"https://api.github.com/users/dancannon/repos","events_url":"https://api.github.com/users/dancannon/events{/privacy}","received_events_url":"https://api.github.com/users/dancannon/received_events","type":"User","site_admin":false},"body":"While it doesnt make too much difference I think it would probably be clearer if we avoided using reflection here.","created_at":"2015-03-10T20:47:42Z","updated_at":"2015-03-10T20:47:42Z","html_url":"https://github.com/dancannon/gorethink/pull/160#discussion_r26164272","pull_request_url":"https://api.github.com/repos/dancannon/gorethink/pulls/160","_links":{"self":{"href":"https://api.github.com/repos/dancannon/gorethink/pulls/comments/26164272"},"html":{"href":"https://github.com/dancannon/gorethink/pull/160#discussion_r26164272"},"pull_request":{"href":"https://api.github.com/repos/dancannon/gorethink/pulls/160"}}},"pull_request":{"url":"https://api.github.com/repos/dancannon/gorethink/pulls/160","id":30887042,"html_url":"https://github.com/dancannon/gorethink/pull/160","diff_url":"https://github.com/dancannon/gorethink/pull/160.diff","patch_url":"https://github.com/dancannon/gorethink/pull/160.patch","issue_url":"https://api.github.com/repos/dancannon/gorethink/issues/160","number":160,"state":"open","locked":false,"title":"fix: refactored tests dependant on float assertion","user":{"login":"jaredfolkins","id":176908,"avatar_url":"https://avatars.githubusercontent.com/u/176908?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredfolkins","html_url":"https://github.com/jaredfolkins","followers_url":"https://api.github.com/users/jaredfolkins/followers","following_url":"https://api.github.com/users/jaredfolkins/following{/other_user}","gists_url":"https://api.github.com/users/jaredfolkins/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredfolkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredfolkins/subscriptions","organizations_url":"https://api.github.com/users/jaredfolkins/orgs","repos_url":"https://api.github.com/users/jaredfolkins/repos","events_url":"https://api.github.com/users/jaredfolkins/events{/privacy}","received_events_url":"https://api.github.com/users/jaredfolkins/received_events","type":"User","site_admin":false},"body":"Hi Dan,\r\n\r\nAs promised, here are the fixes for the tests. \r\n\r\nI created some helper methods which essentially ripoff Go's stdlib.\r\n\r\nFrom there I refactored the coordinates into float64 vertexes. \r\n\r\nI then used a helper method I created to compare the coordinates instantiated to the Lines and Points returned, throwing an error if the deviation is too great.\r\n\r\nI think this is readable but am open to feedback.\r\n\r\nJared","created_at":"2015-03-10T20:04:55Z","updated_at":"2015-03-10T20:47:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4f91baf3137b976cebc31467358c3a9208c3e1c3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dancannon/gorethink/pulls/160/commits","review_comments_url":"https://api.github.com/repos/dancannon/gorethink/pulls/160/comments","review_comment_url":"https://api.github.com/repos/dancannon/gorethink/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dancannon/gorethink/issues/160/comments","statuses_url":"https://api.github.com/repos/dancannon/gorethink/statuses/153cd2deb30211ffc90f56095e46e4ac24eee924","head":{"label":"jaredfolkins:master","ref":"master","sha":"153cd2deb30211ffc90f56095e46e4ac24eee924","user":{"login":"jaredfolkins","id":176908,"avatar_url":"https://avatars.githubusercontent.com/u/176908?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredfolkins","html_url":"https://github.com/jaredfolkins","followers_url":"https://api.github.com/users/jaredfolkins/followers","following_url":"https://api.github.com/users/jaredfolkins/following{/other_user}","gists_url":"https://api.github.com/users/jaredfolkins/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredfolkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredfolkins/subscriptions","organizations_url":"https://api.github.com/users/jaredfolkins/orgs","repos_url":"https://api.github.com/users/jaredfolkins/repos","events_url":"https://api.github.com/users/jaredfolkins/events{/privacy}","received_events_url":"https://api.github.com/users/jaredfolkins/received_events","type":"User","site_admin":false},"repo":{"id":31685330,"name":"gorethink","full_name":"jaredfolkins/gorethink","owner":{"login":"jaredfolkins","id":176908,"avatar_url":"https://avatars.githubusercontent.com/u/176908?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredfolkins","html_url":"https://github.com/jaredfolkins","followers_url":"https://api.github.com/users/jaredfolkins/followers","following_url":"https://api.github.com/users/jaredfolkins/following{/other_user}","gists_url":"https://api.github.com/users/jaredfolkins/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredfolkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredfolkins/subscriptions","organizations_url":"https://api.github.com/users/jaredfolkins/orgs","repos_url":"https://api.github.com/users/jaredfolkins/repos","events_url":"https://api.github.com/users/jaredfolkins/events{/privacy}","received_events_url":"https://api.github.com/users/jaredfolkins/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jaredfolkins/gorethink","description":"Go language driver for RethinkDB","fork":true,"url":"https://api.github.com/repos/jaredfolkins/gorethink","forks_url":"https://api.github.com/repos/jaredfolkins/gorethink/forks","keys_url":"https://api.github.com/repos/jaredfolkins/gorethink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jaredfolkins/gorethink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jaredfolkins/gorethink/teams","hooks_url":"https://api.github.com/repos/jaredfolkins/gorethink/hooks","issue_events_url":"https://api.github.com/repos/jaredfolkins/gorethink/issues/events{/number}","events_url":"https://api.github.com/repos/jaredfolkins/gorethink/events","assignees_url":"https://api.github.com/repos/jaredfolkins/gorethink/assignees{/user}","branches_url":"https://api.github.com/repos/jaredfolkins/gorethink/branches{/branch}","tags_url":"https://api.github.com/repos/jaredfolkins/gorethink/tags","blobs_url":"https://api.github.com/repos/jaredfolkins/gorethink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jaredfolkins/gorethink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jaredfolkins/gorethink/git/refs{/sha}","trees_url":"https://api.github.com/repos/jaredfolkins/gorethink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jaredfolkins/gorethink/statuses/{sha}","languages_url":"https://api.github.com/repos/jaredfolkins/gorethink/languages","stargazers_url":"https://api.github.com/repos/jaredfolkins/gorethink/stargazers","contributors_url":"https://api.github.com/repos/jaredfolkins/gorethink/contributors","subscribers_url":"https://api.github.com/repos/jaredfolkins/gorethink/subscribers","subscription_url":"https://api.github.com/repos/jaredfolkins/gorethink/subscription","commits_url":"https://api.github.com/repos/jaredfolkins/gorethink/commits{/sha}","git_commits_url":"https://api.github.com/repos/jaredfolkins/gorethink/git/commits{/sha}","comments_url":"https://api.github.com/repos/jaredfolkins/gorethink/comments{/number}","issue_comment_url":"https://api.github.com/repos/jaredfolkins/gorethink/issues/comments{/number}","contents_url":"https://api.github.com/repos/jaredfolkins/gorethink/contents/{+path}","compare_url":"https://api.github.com/repos/jaredfolkins/gorethink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jaredfolkins/gorethink/merges","archive_url":"https://api.github.com/repos/jaredfolkins/gorethink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jaredfolkins/gorethink/downloads","issues_url":"https://api.github.com/repos/jaredfolkins/gorethink/issues{/number}","pulls_url":"https://api.github.com/repos/jaredfolkins/gorethink/pulls{/number}","milestones_url":"https://api.github.com/repos/jaredfolkins/gorethink/milestones{/number}","notifications_url":"https://api.github.com/repos/jaredfolkins/gorethink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jaredfolkins/gorethink/labels{/name}","releases_url":"https://api.github.com/repos/jaredfolkins/gorethink/releases{/id}","created_at":"2015-03-04T23:22:24Z","updated_at":"2015-03-10T20:01:34Z","pushed_at":"2015-03-10T20:01:32Z","git_url":"git://github.com/jaredfolkins/gorethink.git","ssh_url":"git@github.com:jaredfolkins/gorethink.git","clone_url":"https://github.com/jaredfolkins/gorethink.git","svn_url":"https://github.com/jaredfolkins/gorethink","homepage":"","size":869,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dancannon:master","ref":"master","sha":"a05fb9f684e7bcf6ada71ff71b8b73ba28e63a6a","user":{"login":"dancannon","id":414768,"avatar_url":"https://avatars.githubusercontent.com/u/414768?v=3","gravatar_id":"","url":"https://api.github.com/users/dancannon","html_url":"https://github.com/dancannon","followers_url":"https://api.github.com/users/dancannon/followers","following_url":"https://api.github.com/users/dancannon/following{/other_user}","gists_url":"https://api.github.com/users/dancannon/gists{/gist_id}","starred_url":"https://api.github.com/users/dancannon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dancannon/subscriptions","organizations_url":"https://api.github.com/users/dancannon/orgs","repos_url":"https://api.github.com/users/dancannon/repos","events_url":"https://api.github.com/users/dancannon/events{/privacy}","received_events_url":"https://api.github.com/users/dancannon/received_events","type":"User","site_admin":false},"repo":{"id":12785038,"name":"gorethink","full_name":"dancannon/gorethink","owner":{"login":"dancannon","id":414768,"avatar_url":"https://avatars.githubusercontent.com/u/414768?v=3","gravatar_id":"","url":"https://api.github.com/users/dancannon","html_url":"https://github.com/dancannon","followers_url":"https://api.github.com/users/dancannon/followers","following_url":"https://api.github.com/users/dancannon/following{/other_user}","gists_url":"https://api.github.com/users/dancannon/gists{/gist_id}","starred_url":"https://api.github.com/users/dancannon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dancannon/subscriptions","organizations_url":"https://api.github.com/users/dancannon/orgs","repos_url":"https://api.github.com/users/dancannon/repos","events_url":"https://api.github.com/users/dancannon/events{/privacy}","received_events_url":"https://api.github.com/users/dancannon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dancannon/gorethink","description":"Go language driver for RethinkDB","fork":false,"url":"https://api.github.com/repos/dancannon/gorethink","forks_url":"https://api.github.com/repos/dancannon/gorethink/forks","keys_url":"https://api.github.com/repos/dancannon/gorethink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dancannon/gorethink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dancannon/gorethink/teams","hooks_url":"https://api.github.com/repos/dancannon/gorethink/hooks","issue_events_url":"https://api.github.com/repos/dancannon/gorethink/issues/events{/number}","events_url":"https://api.github.com/repos/dancannon/gorethink/events","assignees_url":"https://api.github.com/repos/dancannon/gorethink/assignees{/user}","branches_url":"https://api.github.com/repos/dancannon/gorethink/branches{/branch}","tags_url":"https://api.github.com/repos/dancannon/gorethink/tags","blobs_url":"https://api.github.com/repos/dancannon/gorethink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dancannon/gorethink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dancannon/gorethink/git/refs{/sha}","trees_url":"https://api.github.com/repos/dancannon/gorethink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dancannon/gorethink/statuses/{sha}","languages_url":"https://api.github.com/repos/dancannon/gorethink/languages","stargazers_url":"https://api.github.com/repos/dancannon/gorethink/stargazers","contributors_url":"https://api.github.com/repos/dancannon/gorethink/contributors","subscribers_url":"https://api.github.com/repos/dancannon/gorethink/subscribers","subscription_url":"https://api.github.com/repos/dancannon/gorethink/subscription","commits_url":"https://api.github.com/repos/dancannon/gorethink/commits{/sha}","git_commits_url":"https://api.github.com/repos/dancannon/gorethink/git/commits{/sha}","comments_url":"https://api.github.com/repos/dancannon/gorethink/comments{/number}","issue_comment_url":"https://api.github.com/repos/dancannon/gorethink/issues/comments{/number}","contents_url":"https://api.github.com/repos/dancannon/gorethink/contents/{+path}","compare_url":"https://api.github.com/repos/dancannon/gorethink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dancannon/gorethink/merges","archive_url":"https://api.github.com/repos/dancannon/gorethink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dancannon/gorethink/downloads","issues_url":"https://api.github.com/repos/dancannon/gorethink/issues{/number}","pulls_url":"https://api.github.com/repos/dancannon/gorethink/pulls{/number}","milestones_url":"https://api.github.com/repos/dancannon/gorethink/milestones{/number}","notifications_url":"https://api.github.com/repos/dancannon/gorethink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dancannon/gorethink/labels{/name}","releases_url":"https://api.github.com/repos/dancannon/gorethink/releases{/id}","created_at":"2013-09-12T13:56:27Z","updated_at":"2015-03-10T13:05:08Z","pushed_at":"2015-03-04T23:23:11Z","git_url":"git://github.com/dancannon/gorethink.git","ssh_url":"git@github.com:dancannon/gorethink.git","clone_url":"https://github.com/dancannon/gorethink.git","svn_url":"https://github.com/dancannon/gorethink","homepage":"","size":2248,"stargazers_count":319,"watchers_count":319,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"open_issues_count":5,"forks":29,"open_issues":5,"watchers":319,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dancannon/gorethink/pulls/160"},"html":{"href":"https://github.com/dancannon/gorethink/pull/160"},"issue":{"href":"https://api.github.com/repos/dancannon/gorethink/issues/160"},"comments":{"href":"https://api.github.com/repos/dancannon/gorethink/issues/160/comments"},"review_comments":{"href":"https://api.github.com/repos/dancannon/gorethink/pulls/160/comments"},"review_comment":{"href":"https://api.github.com/repos/dancannon/gorethink/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dancannon/gorethink/pulls/160/commits"},"statuses":{"href":"https://api.github.com/repos/dancannon/gorethink/statuses/153cd2deb30211ffc90f56095e46e4ac24eee924"}}}}