{"action":"created","comment":{"url":"https://api.github.com/repos/Raizlabs/Swiftilities/pulls/comments/72998658","id":72998658,"diff_hunk":"@@ -25,4 +25,58 @@ class Tests: XCTestCase {\n         XCTAssertEqualWithAccuracy(-10.0.scale(from: -50.0...0.0, to: 0.0...1.0, clamp: true), -1.0, accuracy: epsilon)\n     }\n \n+    func testIntegerTypeRandom() {\n+        Int.testRandom()\n+        Int64.testRandom()\n+        Int32.testRandom()\n+        Int16.testRandom()\n+        Int8.testRandom()\n+\n+        UInt.testRandom()\n+        UInt64.testRandom()\n+        UInt32.testRandom()\n+        UInt16.testRandom()\n+        UInt8.testRandom()\n+    }\n+\n+}\n+\n+private extension UnsignedIntegerType where Stride == Int {\n+\n+    static func testRandom() {\n+        for _ in 0...10000 {\n+            Self.testRandomBoundaries(0, max: 0)\n+            Self.testRandomBoundaries(0, max: 1)\n+            Self.testRandomBoundaries(0, max: 13)\n+        }\n+    }\n+\n+    static func testRandomBoundaries(min: UIntMax, max: UIntMax) {\n+        let randomInt = Self.random(Self(min), max: Self(max))\n+        XCTAssertLessThanOrEqual(randomInt, Self(max))\n+        XCTAssertGreaterThanOrEqual(randomInt, Self(min))\n+    }\n+\n+}\n+\n+private extension SignedIntegerType where Stride == Int {\n+\n+    static func testRandom() {\n+        for _ in 0...10000 {\n+            Self.testRandomBoundaries(0, max: 0)\n+            Self.testRandomBoundaries(0, max: 1)\n+            Self.testRandomBoundaries(0, max: 13)\n+\n+            Self.testRandomBoundaries(-1, max: 0)\n+            Self.testRandomBoundaries(-13, max: 0)\n+            Self.testRandomBoundaries(-13, max: 13)\n+        }\n+    }\n+\n+    static func testRandomBoundaries(min: IntMax, max: IntMax) {","path":"Example/Tests/MathTests.swift","position":52,"original_position":52,"commit_id":"69bd8a032907e2d72d14f98e6651904749a0a5e7","original_commit_id":"69bd8a032907e2d72d14f98e6651904749a0a5e7","user":{"login":"ZevEisenberg","id":464574,"avatar_url":"https://avatars.githubusercontent.com/u/464574?v=3","gravatar_id":"","url":"https://api.github.com/users/ZevEisenberg","html_url":"https://github.com/ZevEisenberg","followers_url":"https://api.github.com/users/ZevEisenberg/followers","following_url":"https://api.github.com/users/ZevEisenberg/following{/other_user}","gists_url":"https://api.github.com/users/ZevEisenberg/gists{/gist_id}","starred_url":"https://api.github.com/users/ZevEisenberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZevEisenberg/subscriptions","organizations_url":"https://api.github.com/users/ZevEisenberg/orgs","repos_url":"https://api.github.com/users/ZevEisenberg/repos","events_url":"https://api.github.com/users/ZevEisenberg/events{/privacy}","received_events_url":"https://api.github.com/users/ZevEisenberg/received_events","type":"User","site_admin":false},"body":"#? why isn't the type of this parameter `Self`?","created_at":"2016-08-01T15:30:45Z","updated_at":"2016-08-01T15:30:45Z","html_url":"https://github.com/Raizlabs/Swiftilities/pull/31#discussion_r72998658","pull_request_url":"https://api.github.com/repos/Raizlabs/Swiftilities/pulls/31","_links":{"self":{"href":"https://api.github.com/repos/Raizlabs/Swiftilities/pulls/comments/72998658"},"html":{"href":"https://github.com/Raizlabs/Swiftilities/pull/31#discussion_r72998658"},"pull_request":{"href":"https://api.github.com/repos/Raizlabs/Swiftilities/pulls/31"}}},"pull_request":{"url":"https://api.github.com/repos/Raizlabs/Swiftilities/pulls/31","id":78780550,"html_url":"https://github.com/Raizlabs/Swiftilities/pull/31","diff_url":"https://github.com/Raizlabs/Swiftilities/pull/31.diff","patch_url":"https://github.com/Raizlabs/Swiftilities/pull/31.patch","issue_url":"https://api.github.com/repos/Raizlabs/Swiftilities/issues/31","number":31,"state":"open","locked":false,"title":"Integer Random Extensions [WIP]","user":{"login":"robcadwallader","id":1005536,"avatar_url":"https://avatars.githubusercontent.com/u/1005536?v=3","gravatar_id":"","url":"https://api.github.com/users/robcadwallader","html_url":"https://github.com/robcadwallader","followers_url":"https://api.github.com/users/robcadwallader/followers","following_url":"https://api.github.com/users/robcadwallader/following{/other_user}","gists_url":"https://api.github.com/users/robcadwallader/gists{/gist_id}","starred_url":"https://api.github.com/users/robcadwallader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robcadwallader/subscriptions","organizations_url":"https://api.github.com/users/robcadwallader/orgs","repos_url":"https://api.github.com/users/robcadwallader/repos","events_url":"https://api.github.com/users/robcadwallader/events{/privacy}","received_events_url":"https://api.github.com/users/robcadwallader/received_events","type":"User","site_admin":false},"body":"Extensions on IntegerType and UnsignedIntegerType to provide a basic random method to most integer types.","created_at":"2016-07-26T01:57:13Z","updated_at":"2016-08-01T15:30:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"727d54755d534671013cd6ae4db27579bffedc75","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Raizlabs/Swiftilities/pulls/31/commits","review_comments_url":"https://api.github.com/repos/Raizlabs/Swiftilities/pulls/31/comments","review_comment_url":"https://api.github.com/repos/Raizlabs/Swiftilities/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Raizlabs/Swiftilities/issues/31/comments","statuses_url":"https://api.github.com/repos/Raizlabs/Swiftilities/statuses/69bd8a032907e2d72d14f98e6651904749a0a5e7","head":{"label":"Raizlabs:feature/robcadwallader/Random","ref":"feature/robcadwallader/Random","sha":"69bd8a032907e2d72d14f98e6651904749a0a5e7","user":{"login":"Raizlabs","id":621479,"avatar_url":"https://avatars.githubusercontent.com/u/621479?v=3","gravatar_id":"","url":"https://api.github.com/users/Raizlabs","html_url":"https://github.com/Raizlabs","followers_url":"https://api.github.com/users/Raizlabs/followers","following_url":"https://api.github.com/users/Raizlabs/following{/other_user}","gists_url":"https://api.github.com/users/Raizlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/Raizlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raizlabs/subscriptions","organizations_url":"https://api.github.com/users/Raizlabs/orgs","repos_url":"https://api.github.com/users/Raizlabs/repos","events_url":"https://api.github.com/users/Raizlabs/events{/privacy}","received_events_url":"https://api.github.com/users/Raizlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":51174530,"name":"Swiftilities","full_name":"Raizlabs/Swiftilities","owner":{"login":"Raizlabs","id":621479,"avatar_url":"https://avatars.githubusercontent.com/u/621479?v=3","gravatar_id":"","url":"https://api.github.com/users/Raizlabs","html_url":"https://github.com/Raizlabs","followers_url":"https://api.github.com/users/Raizlabs/followers","following_url":"https://api.github.com/users/Raizlabs/following{/other_user}","gists_url":"https://api.github.com/users/Raizlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/Raizlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raizlabs/subscriptions","organizations_url":"https://api.github.com/users/Raizlabs/orgs","repos_url":"https://api.github.com/users/Raizlabs/repos","events_url":"https://api.github.com/users/Raizlabs/events{/privacy}","received_events_url":"https://api.github.com/users/Raizlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Raizlabs/Swiftilities","description":"A collection of useful Swift utilities.","fork":false,"url":"https://api.github.com/repos/Raizlabs/Swiftilities","forks_url":"https://api.github.com/repos/Raizlabs/Swiftilities/forks","keys_url":"https://api.github.com/repos/Raizlabs/Swiftilities/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Raizlabs/Swiftilities/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Raizlabs/Swiftilities/teams","hooks_url":"https://api.github.com/repos/Raizlabs/Swiftilities/hooks","issue_events_url":"https://api.github.com/repos/Raizlabs/Swiftilities/issues/events{/number}","events_url":"https://api.github.com/repos/Raizlabs/Swiftilities/events","assignees_url":"https://api.github.com/repos/Raizlabs/Swiftilities/assignees{/user}","branches_url":"https://api.github.com/repos/Raizlabs/Swiftilities/branches{/branch}","tags_url":"https://api.github.com/repos/Raizlabs/Swiftilities/tags","blobs_url":"https://api.github.com/repos/Raizlabs/Swiftilities/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Raizlabs/Swiftilities/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Raizlabs/Swiftilities/git/refs{/sha}","trees_url":"https://api.github.com/repos/Raizlabs/Swiftilities/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Raizlabs/Swiftilities/statuses/{sha}","languages_url":"https://api.github.com/repos/Raizlabs/Swiftilities/languages","stargazers_url":"https://api.github.com/repos/Raizlabs/Swiftilities/stargazers","contributors_url":"https://api.github.com/repos/Raizlabs/Swiftilities/contributors","subscribers_url":"https://api.github.com/repos/Raizlabs/Swiftilities/subscribers","subscription_url":"https://api.github.com/repos/Raizlabs/Swiftilities/subscription","commits_url":"https://api.github.com/repos/Raizlabs/Swiftilities/commits{/sha}","git_commits_url":"https://api.github.com/repos/Raizlabs/Swiftilities/git/commits{/sha}","comments_url":"https://api.github.com/repos/Raizlabs/Swiftilities/comments{/number}","issue_comment_url":"https://api.github.com/repos/Raizlabs/Swiftilities/issues/comments{/number}","contents_url":"https://api.github.com/repos/Raizlabs/Swiftilities/contents/{+path}","compare_url":"https://api.github.com/repos/Raizlabs/Swiftilities/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Raizlabs/Swiftilities/merges","archive_url":"https://api.github.com/repos/Raizlabs/Swiftilities/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Raizlabs/Swiftilities/downloads","issues_url":"https://api.github.com/repos/Raizlabs/Swiftilities/issues{/number}","pulls_url":"https://api.github.com/repos/Raizlabs/Swiftilities/pulls{/number}","milestones_url":"https://api.github.com/repos/Raizlabs/Swiftilities/milestones{/number}","notifications_url":"https://api.github.com/repos/Raizlabs/Swiftilities/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Raizlabs/Swiftilities/labels{/name}","releases_url":"https://api.github.com/repos/Raizlabs/Swiftilities/releases{/id}","deployments_url":"https://api.github.com/repos/Raizlabs/Swiftilities/deployments","created_at":"2016-02-05T21:17:15Z","updated_at":"2016-08-01T07:33:19Z","pushed_at":"2016-07-29T23:04:32Z","git_url":"git://github.com/Raizlabs/Swiftilities.git","ssh_url":"git@github.com:Raizlabs/Swiftilities.git","clone_url":"https://github.com/Raizlabs/Swiftilities.git","svn_url":"https://github.com/Raizlabs/Swiftilities","homepage":null,"size":156,"stargazers_count":29,"watchers_count":29,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":24,"forks":0,"open_issues":24,"watchers":29,"default_branch":"develop"}},"base":{"label":"Raizlabs:develop","ref":"develop","sha":"23b5de0f5e97e22af8f25799c068fe2d2159b161","user":{"login":"Raizlabs","id":621479,"avatar_url":"https://avatars.githubusercontent.com/u/621479?v=3","gravatar_id":"","url":"https://api.github.com/users/Raizlabs","html_url":"https://github.com/Raizlabs","followers_url":"https://api.github.com/users/Raizlabs/followers","following_url":"https://api.github.com/users/Raizlabs/following{/other_user}","gists_url":"https://api.github.com/users/Raizlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/Raizlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raizlabs/subscriptions","organizations_url":"https://api.github.com/users/Raizlabs/orgs","repos_url":"https://api.github.com/users/Raizlabs/repos","events_url":"https://api.github.com/users/Raizlabs/events{/privacy}","received_events_url":"https://api.github.com/users/Raizlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":51174530,"name":"Swiftilities","full_name":"Raizlabs/Swiftilities","owner":{"login":"Raizlabs","id":621479,"avatar_url":"https://avatars.githubusercontent.com/u/621479?v=3","gravatar_id":"","url":"https://api.github.com/users/Raizlabs","html_url":"https://github.com/Raizlabs","followers_url":"https://api.github.com/users/Raizlabs/followers","following_url":"https://api.github.com/users/Raizlabs/following{/other_user}","gists_url":"https://api.github.com/users/Raizlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/Raizlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raizlabs/subscriptions","organizations_url":"https://api.github.com/users/Raizlabs/orgs","repos_url":"https://api.github.com/users/Raizlabs/repos","events_url":"https://api.github.com/users/Raizlabs/events{/privacy}","received_events_url":"https://api.github.com/users/Raizlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Raizlabs/Swiftilities","description":"A collection of useful Swift utilities.","fork":false,"url":"https://api.github.com/repos/Raizlabs/Swiftilities","forks_url":"https://api.github.com/repos/Raizlabs/Swiftilities/forks","keys_url":"https://api.github.com/repos/Raizlabs/Swiftilities/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Raizlabs/Swiftilities/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Raizlabs/Swiftilities/teams","hooks_url":"https://api.github.com/repos/Raizlabs/Swiftilities/hooks","issue_events_url":"https://api.github.com/repos/Raizlabs/Swiftilities/issues/events{/number}","events_url":"https://api.github.com/repos/Raizlabs/Swiftilities/events","assignees_url":"https://api.github.com/repos/Raizlabs/Swiftilities/assignees{/user}","branches_url":"https://api.github.com/repos/Raizlabs/Swiftilities/branches{/branch}","tags_url":"https://api.github.com/repos/Raizlabs/Swiftilities/tags","blobs_url":"https://api.github.com/repos/Raizlabs/Swiftilities/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Raizlabs/Swiftilities/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Raizlabs/Swiftilities/git/refs{/sha}","trees_url":"https://api.github.com/repos/Raizlabs/Swiftilities/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Raizlabs/Swiftilities/statuses/{sha}","languages_url":"https://api.github.com/repos/Raizlabs/Swiftilities/languages","stargazers_url":"https://api.github.com/repos/Raizlabs/Swiftilities/stargazers","contributors_url":"https://api.github.com/repos/Raizlabs/Swiftilities/contributors","subscribers_url":"https://api.github.com/repos/Raizlabs/Swiftilities/subscribers","subscription_url":"https://api.github.com/repos/Raizlabs/Swiftilities/subscription","commits_url":"https://api.github.com/repos/Raizlabs/Swiftilities/commits{/sha}","git_commits_url":"https://api.github.com/repos/Raizlabs/Swiftilities/git/commits{/sha}","comments_url":"https://api.github.com/repos/Raizlabs/Swiftilities/comments{/number}","issue_comment_url":"https://api.github.com/repos/Raizlabs/Swiftilities/issues/comments{/number}","contents_url":"https://api.github.com/repos/Raizlabs/Swiftilities/contents/{+path}","compare_url":"https://api.github.com/repos/Raizlabs/Swiftilities/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Raizlabs/Swiftilities/merges","archive_url":"https://api.github.com/repos/Raizlabs/Swiftilities/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Raizlabs/Swiftilities/downloads","issues_url":"https://api.github.com/repos/Raizlabs/Swiftilities/issues{/number}","pulls_url":"https://api.github.com/repos/Raizlabs/Swiftilities/pulls{/number}","milestones_url":"https://api.github.com/repos/Raizlabs/Swiftilities/milestones{/number}","notifications_url":"https://api.github.com/repos/Raizlabs/Swiftilities/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Raizlabs/Swiftilities/labels{/name}","releases_url":"https://api.github.com/repos/Raizlabs/Swiftilities/releases{/id}","deployments_url":"https://api.github.com/repos/Raizlabs/Swiftilities/deployments","created_at":"2016-02-05T21:17:15Z","updated_at":"2016-08-01T07:33:19Z","pushed_at":"2016-07-29T23:04:32Z","git_url":"git://github.com/Raizlabs/Swiftilities.git","ssh_url":"git@github.com:Raizlabs/Swiftilities.git","clone_url":"https://github.com/Raizlabs/Swiftilities.git","svn_url":"https://github.com/Raizlabs/Swiftilities","homepage":null,"size":156,"stargazers_count":29,"watchers_count":29,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":24,"forks":0,"open_issues":24,"watchers":29,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Raizlabs/Swiftilities/pulls/31"},"html":{"href":"https://github.com/Raizlabs/Swiftilities/pull/31"},"issue":{"href":"https://api.github.com/repos/Raizlabs/Swiftilities/issues/31"},"comments":{"href":"https://api.github.com/repos/Raizlabs/Swiftilities/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/Raizlabs/Swiftilities/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/Raizlabs/Swiftilities/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Raizlabs/Swiftilities/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/Raizlabs/Swiftilities/statuses/69bd8a032907e2d72d14f98e6651904749a0a5e7"}}}}
{"actor":{"display_login":"ZevEisenberg"}}