{"action":"created","comment":{"url":"https://api.github.com/repos/non/spire/pulls/comments/29288244","id":29288244,"diff_hunk":"@@ -0,0 +1,32 @@\n+package spire.laws.cooperative_equality\n+\n+import org.scalacheck.{Prop, Properties, Arbitrary, Gen}\n+import org.scalacheck.Prop.forAll\n+import org.scalacheck.Prop._\n+import org.scalacheck.Arbitrary._\n+\n+import spire.math.{Jet, JetDim}\n+import spire.implicits._\n+\n+object JetCoopEqProp extends Properties(\"Jet\") {\n+\n+\timplicit val jetDim: JetDim = JetDim(23) // 23 is arbitrary\n+\n+\t// val genInt: Gen[Jet[Int]]       = arbitrary[Int].map(Jet(_))\n+\t// val genLong: Gen[Jet[Long]]     = arbitrary[Long].map(Jet(_))\n+\tval genDouble: Gen[Jet[Double]] = arbitrary[Double].map(Jet(_))\n+\tval genFloat: Gen[Jet[Float]]   = arbitrary[Float].map(Jet(_))\t\n+\t// val genBigInt: Gen[Jet[BigInt]] = arbitrary[BigInt].map(Jet(_))\n+\n+\t// val intProps: List[Prop]    = Utility.props[Jet[Int]](genInt)\n+\tval doubleProps: List[Prop] = Utility.props[Jet[Double]](genDouble)\n+\t// val longProps: List[Prop]   = Utility.props[Jet[Long]](genLong)\n+\t// val bigIntProps: List[Prop] = Utility.props[Jet[BigInt]](genBigInt)\n+\tval floatProps: List[Prop]  = Utility.props[Jet[Float]](genFloat)\n+\n+  \tUtility.printPreTestRun(Utility.JET, Utility.FLOAT)\n+  \tfloatProps.foreach(_.check)\n+\n+  \tUtility.printPreTestRun(Utility.JET, Utility.DOUBLE)\n+  \tdoubleProps.foreach(_.check)  \t\n+}","path":"tests/src/test/scala/spire/laws/cooperative_equality/JetCoopEqProp.scala","position":32,"original_position":32,"commit_id":"f81e6c91bf317cbdf2f4f7cd89d1a4302c03408b","original_commit_id":"f81e6c91bf317cbdf2f4f7cd89d1a4302c03408b","user":{"login":"non","id":218045,"avatar_url":"https://avatars.githubusercontent.com/u/218045?v=3","gravatar_id":"","url":"https://api.github.com/users/non","html_url":"https://github.com/non","followers_url":"https://api.github.com/users/non/followers","following_url":"https://api.github.com/users/non/following{/other_user}","gists_url":"https://api.github.com/users/non/gists{/gist_id}","starred_url":"https://api.github.com/users/non/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/non/subscriptions","organizations_url":"https://api.github.com/users/non/orgs","repos_url":"https://api.github.com/users/non/repos","events_url":"https://api.github.com/users/non/events{/privacy}","received_events_url":"https://api.github.com/users/non/received_events","type":"User","site_admin":false},"body":"Please make sure to add a newline at the end of the file.","created_at":"2015-04-28T21:02:20Z","updated_at":"2015-04-28T21:02:20Z","html_url":"https://github.com/non/spire/pull/436#discussion_r29288244","pull_request_url":"https://api.github.com/repos/non/spire/pulls/436","_links":{"self":{"href":"https://api.github.com/repos/non/spire/pulls/comments/29288244"},"html":{"href":"https://github.com/non/spire/pull/436#discussion_r29288244"},"pull_request":{"href":"https://api.github.com/repos/non/spire/pulls/436"}}},"pull_request":{"url":"https://api.github.com/repos/non/spire/pulls/436","id":34286135,"html_url":"https://github.com/non/spire/pull/436","diff_url":"https://github.com/non/spire/pull/436.diff","patch_url":"https://github.com/non/spire/pull/436.patch","issue_url":"https://api.github.com/repos/non/spire/issues/436","number":436,"state":"open","locked":false,"title":"Add Cooperative Equality tests per issue 405","user":{"login":"kevinmeredith","id":1967302,"avatar_url":"https://avatars.githubusercontent.com/u/1967302?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinmeredith","html_url":"https://github.com/kevinmeredith","followers_url":"https://api.github.com/users/kevinmeredith/followers","following_url":"https://api.github.com/users/kevinmeredith/following{/other_user}","gists_url":"https://api.github.com/users/kevinmeredith/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinmeredith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinmeredith/subscriptions","organizations_url":"https://api.github.com/users/kevinmeredith/orgs","repos_url":"https://api.github.com/users/kevinmeredith/repos","events_url":"https://api.github.com/users/kevinmeredith/events{/privacy}","received_events_url":"https://api.github.com/users/kevinmeredith/received_events","type":"User","site_admin":false},"body":"Addresses https://github.com/non/spire/issues/405.\r\n\r\nI looked at each type's companion object's `apply` methods. Then, I, more or less, constructed a `Gen[Type]`, for each of the `apply` methods for Algebraic, ..., ULong.\r\n\r\nThe main tests are given by:\r\n\r\n```\r\n  def props[A : Semiring](g: Gen[A]): List[Prop] = {\r\n    val commutativeAdd = forAll(g, g) { (a: A, b: A) =>\r\n      coopEquals(a+b,b+a) \r\n    }\r\n    val commutativeMult = forAll(g, g) { (a: A, b: A) =>\r\n      coopEquals(a*b,b*a) \r\n    }\r\n    val transitive = forAll(g, g, g) { (a: A, b: A, c: A) =>\r\n      if( coopEquals(a, b) && coopEquals(b, c)) coopEquals(a, c) else true\r\n    }\r\n    List(coopEqProp(g), commutativeAdd, commutativeMult, transitive)\r\n  }\r\n```\r\n\r\nAlso, note that some property-based tests had failed. This PR does not introduce build-breaking tests. In other words, the result of the property-based tests simply gets printed out.\r\n\r\nI figured it'd be reasonable to only add property-based tests in this PR. Then, perhaps a follow-up PR can address the failed cooperative equality tests.\r\n\r\n","created_at":"2015-04-28T16:37:02Z","updated_at":"2015-04-28T21:02:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"70cc15523ac54e2b9acfe3f0de0a726157809045","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/non/spire/pulls/436/commits","review_comments_url":"https://api.github.com/repos/non/spire/pulls/436/comments","review_comment_url":"https://api.github.com/repos/non/spire/pulls/comments{/number}","comments_url":"https://api.github.com/repos/non/spire/issues/436/comments","statuses_url":"https://api.github.com/repos/non/spire/statuses/f81e6c91bf317cbdf2f4f7cd89d1a4302c03408b","head":{"label":"kevinmeredith:coop_eq_issue_405","ref":"coop_eq_issue_405","sha":"f81e6c91bf317cbdf2f4f7cd89d1a4302c03408b","user":{"login":"kevinmeredith","id":1967302,"avatar_url":"https://avatars.githubusercontent.com/u/1967302?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinmeredith","html_url":"https://github.com/kevinmeredith","followers_url":"https://api.github.com/users/kevinmeredith/followers","following_url":"https://api.github.com/users/kevinmeredith/following{/other_user}","gists_url":"https://api.github.com/users/kevinmeredith/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinmeredith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinmeredith/subscriptions","organizations_url":"https://api.github.com/users/kevinmeredith/orgs","repos_url":"https://api.github.com/users/kevinmeredith/repos","events_url":"https://api.github.com/users/kevinmeredith/events{/privacy}","received_events_url":"https://api.github.com/users/kevinmeredith/received_events","type":"User","site_admin":false},"repo":{"id":34126837,"name":"spire","full_name":"kevinmeredith/spire","owner":{"login":"kevinmeredith","id":1967302,"avatar_url":"https://avatars.githubusercontent.com/u/1967302?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinmeredith","html_url":"https://github.com/kevinmeredith","followers_url":"https://api.github.com/users/kevinmeredith/followers","following_url":"https://api.github.com/users/kevinmeredith/following{/other_user}","gists_url":"https://api.github.com/users/kevinmeredith/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinmeredith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinmeredith/subscriptions","organizations_url":"https://api.github.com/users/kevinmeredith/orgs","repos_url":"https://api.github.com/users/kevinmeredith/repos","events_url":"https://api.github.com/users/kevinmeredith/events{/privacy}","received_events_url":"https://api.github.com/users/kevinmeredith/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kevinmeredith/spire","description":"Powerful new number types and numeric abstractions for Scala.","fork":true,"url":"https://api.github.com/repos/kevinmeredith/spire","forks_url":"https://api.github.com/repos/kevinmeredith/spire/forks","keys_url":"https://api.github.com/repos/kevinmeredith/spire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kevinmeredith/spire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kevinmeredith/spire/teams","hooks_url":"https://api.github.com/repos/kevinmeredith/spire/hooks","issue_events_url":"https://api.github.com/repos/kevinmeredith/spire/issues/events{/number}","events_url":"https://api.github.com/repos/kevinmeredith/spire/events","assignees_url":"https://api.github.com/repos/kevinmeredith/spire/assignees{/user}","branches_url":"https://api.github.com/repos/kevinmeredith/spire/branches{/branch}","tags_url":"https://api.github.com/repos/kevinmeredith/spire/tags","blobs_url":"https://api.github.com/repos/kevinmeredith/spire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kevinmeredith/spire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kevinmeredith/spire/git/refs{/sha}","trees_url":"https://api.github.com/repos/kevinmeredith/spire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kevinmeredith/spire/statuses/{sha}","languages_url":"https://api.github.com/repos/kevinmeredith/spire/languages","stargazers_url":"https://api.github.com/repos/kevinmeredith/spire/stargazers","contributors_url":"https://api.github.com/repos/kevinmeredith/spire/contributors","subscribers_url":"https://api.github.com/repos/kevinmeredith/spire/subscribers","subscription_url":"https://api.github.com/repos/kevinmeredith/spire/subscription","commits_url":"https://api.github.com/repos/kevinmeredith/spire/commits{/sha}","git_commits_url":"https://api.github.com/repos/kevinmeredith/spire/git/commits{/sha}","comments_url":"https://api.github.com/repos/kevinmeredith/spire/comments{/number}","issue_comment_url":"https://api.github.com/repos/kevinmeredith/spire/issues/comments{/number}","contents_url":"https://api.github.com/repos/kevinmeredith/spire/contents/{+path}","compare_url":"https://api.github.com/repos/kevinmeredith/spire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kevinmeredith/spire/merges","archive_url":"https://api.github.com/repos/kevinmeredith/spire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kevinmeredith/spire/downloads","issues_url":"https://api.github.com/repos/kevinmeredith/spire/issues{/number}","pulls_url":"https://api.github.com/repos/kevinmeredith/spire/pulls{/number}","milestones_url":"https://api.github.com/repos/kevinmeredith/spire/milestones{/number}","notifications_url":"https://api.github.com/repos/kevinmeredith/spire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kevinmeredith/spire/labels{/name}","releases_url":"https://api.github.com/repos/kevinmeredith/spire/releases{/id}","created_at":"2015-04-17T16:19:34Z","updated_at":"2015-04-17T16:19:35Z","pushed_at":"2015-04-28T20:32:22Z","git_url":"git://github.com/kevinmeredith/spire.git","ssh_url":"git@github.com:kevinmeredith/spire.git","clone_url":"https://github.com/kevinmeredith/spire.git","svn_url":"https://github.com/kevinmeredith/spire","homepage":"","size":4628,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"non:master","ref":"master","sha":"7ec8b442da9a1c369cb49270540be1dbb3f84614","user":{"login":"non","id":218045,"avatar_url":"https://avatars.githubusercontent.com/u/218045?v=3","gravatar_id":"","url":"https://api.github.com/users/non","html_url":"https://github.com/non","followers_url":"https://api.github.com/users/non/followers","following_url":"https://api.github.com/users/non/following{/other_user}","gists_url":"https://api.github.com/users/non/gists{/gist_id}","starred_url":"https://api.github.com/users/non/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/non/subscriptions","organizations_url":"https://api.github.com/users/non/orgs","repos_url":"https://api.github.com/users/non/repos","events_url":"https://api.github.com/users/non/events{/privacy}","received_events_url":"https://api.github.com/users/non/received_events","type":"User","site_admin":false},"repo":{"id":2705076,"name":"spire","full_name":"non/spire","owner":{"login":"non","id":218045,"avatar_url":"https://avatars.githubusercontent.com/u/218045?v=3","gravatar_id":"","url":"https://api.github.com/users/non","html_url":"https://github.com/non","followers_url":"https://api.github.com/users/non/followers","following_url":"https://api.github.com/users/non/following{/other_user}","gists_url":"https://api.github.com/users/non/gists{/gist_id}","starred_url":"https://api.github.com/users/non/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/non/subscriptions","organizations_url":"https://api.github.com/users/non/orgs","repos_url":"https://api.github.com/users/non/repos","events_url":"https://api.github.com/users/non/events{/privacy}","received_events_url":"https://api.github.com/users/non/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/non/spire","description":"Powerful new number types and numeric abstractions for Scala.","fork":false,"url":"https://api.github.com/repos/non/spire","forks_url":"https://api.github.com/repos/non/spire/forks","keys_url":"https://api.github.com/repos/non/spire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/non/spire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/non/spire/teams","hooks_url":"https://api.github.com/repos/non/spire/hooks","issue_events_url":"https://api.github.com/repos/non/spire/issues/events{/number}","events_url":"https://api.github.com/repos/non/spire/events","assignees_url":"https://api.github.com/repos/non/spire/assignees{/user}","branches_url":"https://api.github.com/repos/non/spire/branches{/branch}","tags_url":"https://api.github.com/repos/non/spire/tags","blobs_url":"https://api.github.com/repos/non/spire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/non/spire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/non/spire/git/refs{/sha}","trees_url":"https://api.github.com/repos/non/spire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/non/spire/statuses/{sha}","languages_url":"https://api.github.com/repos/non/spire/languages","stargazers_url":"https://api.github.com/repos/non/spire/stargazers","contributors_url":"https://api.github.com/repos/non/spire/contributors","subscribers_url":"https://api.github.com/repos/non/spire/subscribers","subscription_url":"https://api.github.com/repos/non/spire/subscription","commits_url":"https://api.github.com/repos/non/spire/commits{/sha}","git_commits_url":"https://api.github.com/repos/non/spire/git/commits{/sha}","comments_url":"https://api.github.com/repos/non/spire/comments{/number}","issue_comment_url":"https://api.github.com/repos/non/spire/issues/comments{/number}","contents_url":"https://api.github.com/repos/non/spire/contents/{+path}","compare_url":"https://api.github.com/repos/non/spire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/non/spire/merges","archive_url":"https://api.github.com/repos/non/spire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/non/spire/downloads","issues_url":"https://api.github.com/repos/non/spire/issues{/number}","pulls_url":"https://api.github.com/repos/non/spire/pulls{/number}","milestones_url":"https://api.github.com/repos/non/spire/milestones{/number}","notifications_url":"https://api.github.com/repos/non/spire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/non/spire/labels{/name}","releases_url":"https://api.github.com/repos/non/spire/releases{/id}","created_at":"2011-11-03T20:52:53Z","updated_at":"2015-04-28T15:00:02Z","pushed_at":"2015-04-28T20:40:20Z","git_url":"git://github.com/non/spire.git","ssh_url":"git@github.com:non/spire.git","clone_url":"https://github.com/non/spire.git","svn_url":"https://github.com/non/spire","homepage":"","size":8521,"stargazers_count":682,"watchers_count":682,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":90,"mirror_url":null,"open_issues_count":114,"forks":90,"open_issues":114,"watchers":682,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/non/spire/pulls/436"},"html":{"href":"https://github.com/non/spire/pull/436"},"issue":{"href":"https://api.github.com/repos/non/spire/issues/436"},"comments":{"href":"https://api.github.com/repos/non/spire/issues/436/comments"},"review_comments":{"href":"https://api.github.com/repos/non/spire/pulls/436/comments"},"review_comment":{"href":"https://api.github.com/repos/non/spire/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/non/spire/pulls/436/commits"},"statuses":{"href":"https://api.github.com/repos/non/spire/statuses/f81e6c91bf317cbdf2f4f7cd89d1a4302c03408b"}}}}