{"action":"created","comment":{"url":"https://api.github.com/repos/ambiata/disorder/pulls/comments/22443295","id":22443295,"diff_hunk":"@@ -0,0 +1,93 @@\n+package com.ambiata.disorder\n+\n+import org.scalacheck._, Arbitrary._, Gen._\n+import scalaz._, Scalaz._\n+\n+\n+/**\n+  This is replace the use of `Arbtirary[String]` which should allow\n+  for a better spread of test cases apart from the general empty\n+  string and unicode characters that are generally associated with\n+  `Arbitrary[String]`.\n+  */\n+case class S(value: String)\n+\n+object S {\n+\n+  implicit def SArbitrary: Arbitrary[S] =\n+    Arbitrary(for {\n+      v <- Gen.sized(i =>\n+        if (i < 2) Gen.frequency(50 -> emptyString, 50 -> specialChar)\n+        else if (i >= 2 && i < 10) Gen.frequency(2-> emptyString, 3 -> specialChar, 5 -> random, 10 -> sentences, 80 -> words)\n+        else if  (i >= 10 && i < 20) Gen.frequency(50 -> random, 25 -> sentences, 25 -> words)\n+        else arbitrary[String]\n+      )\n+    } yield S(v))\n+\n+  def emptyString: Gen[String] =\n+    Gen.const(\"\")\n+\n+  def specialChar: Gen[String] =\n+    Gen.oneOf(\"\\n\", \"\\\\\", \"\\t\", \"\\uD83D\\uDCA9\")\n+\n+  def random: Gen[String] =\n+    arbitrary[List[Char]] map (_.mkString)\n+\n+  def words: Gen[String] = for {\n+    l <- Gen.oneOf(languages)\n+    d <- Gen.oneOf(delimeters)\n+    f <- Gen.oneOf(descriptions)\n+    t <- Gen.oneOf(terminators)\n+  } yield l + d + f + t\n+\n+  def sentences: Gen[String] = Gen.sized(i => for {\n+    l <- Gen.choose(2, math.max(3, i))\n+    w <- Gen.listOfN(i, words)\n+  } yield w.mkString(\" \"))\n+\n+  val delimeters = List(\"/\", \"|\", \",\", \".\", \"\\n\", \"\\t\", \"\\\\\", \"-\", \"_\", \"`\",  \"~\", \"^\")\n+  val terminators = List(\"!\", \".\")\n+\n+  val languages =  List(\n+      \"Agda\"\n+    , \"Axum\"\n+    , \"Batch\"\n+    , \"C\"","path":"src/main/scala/com/ambiata/disorder/S.scala","position":55,"original_position":55,"commit_id":"4206b89d893a3bd61b1fd6a83b4c0081b23db8a9","original_commit_id":"4206b89d893a3bd61b1fd6a83b4c0081b23db8a9","user":{"login":"nhibberd","id":447873,"avatar_url":"https://avatars.githubusercontent.com/u/447873?v=3","gravatar_id":"","url":"https://api.github.com/users/nhibberd","html_url":"https://github.com/nhibberd","followers_url":"https://api.github.com/users/nhibberd/followers","following_url":"https://api.github.com/users/nhibberd/following{/other_user}","gists_url":"https://api.github.com/users/nhibberd/gists{/gist_id}","starred_url":"https://api.github.com/users/nhibberd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhibberd/subscriptions","organizations_url":"https://api.github.com/users/nhibberd/orgs","repos_url":"https://api.github.com/users/nhibberd/repos","events_url":"https://api.github.com/users/nhibberd/events{/privacy}","received_events_url":"https://api.github.com/users/nhibberd/received_events","type":"User","site_admin":false},"body":"For the arbitrary, so that we can getting a better spread of strings. Not just empty or unicode","created_at":"2015-01-04T22:24:22Z","updated_at":"2015-01-04T22:24:22Z","html_url":"https://github.com/ambiata/disorder/pull/1#discussion_r22443295","pull_request_url":"https://api.github.com/repos/ambiata/disorder/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/ambiata/disorder/pulls/comments/22443295"},"html":{"href":"https://github.com/ambiata/disorder/pull/1#discussion_r22443295"},"pull_request":{"href":"https://api.github.com/repos/ambiata/disorder/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/ambiata/disorder/pulls/1","id":26433112,"html_url":"https://github.com/ambiata/disorder/pull/1","diff_url":"https://github.com/ambiata/disorder/pull/1.diff","patch_url":"https://github.com/ambiata/disorder/pull/1.patch","issue_url":"https://api.github.com/repos/ambiata/disorder/issues/1","number":1,"state":"closed","locked":false,"title":"Adding String arbs","user":{"login":"nhibberd","id":447873,"avatar_url":"https://avatars.githubusercontent.com/u/447873?v=3","gravatar_id":"","url":"https://api.github.com/users/nhibberd","html_url":"https://github.com/nhibberd","followers_url":"https://api.github.com/users/nhibberd/followers","following_url":"https://api.github.com/users/nhibberd/following{/other_user}","gists_url":"https://api.github.com/users/nhibberd/gists{/gist_id}","starred_url":"https://api.github.com/users/nhibberd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhibberd/subscriptions","organizations_url":"https://api.github.com/users/nhibberd/orgs","repos_url":"https://api.github.com/users/nhibberd/repos","events_url":"https://api.github.com/users/nhibberd/events{/privacy}","received_events_url":"https://api.github.com/users/nhibberd/received_events","type":"User","site_admin":false},"body":"@markhibberd ","created_at":"2014-12-21T22:30:30Z","updated_at":"2015-01-04T22:24:22Z","closed_at":"2014-12-21T23:14:18Z","merged_at":"2014-12-21T23:14:18Z","merge_commit_sha":"247bb2e2837fe2279cd8b6a249f87c181c66daa6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ambiata/disorder/pulls/1/commits","review_comments_url":"https://api.github.com/repos/ambiata/disorder/pulls/1/comments","review_comment_url":"https://api.github.com/repos/ambiata/disorder/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ambiata/disorder/issues/1/comments","statuses_url":"https://api.github.com/repos/ambiata/disorder/statuses/4206b89d893a3bd61b1fd6a83b4c0081b23db8a9","head":{"label":"ambiata:topic/string","ref":"topic/string","sha":"4206b89d893a3bd61b1fd6a83b4c0081b23db8a9","user":{"login":"ambiata","id":1691023,"avatar_url":"https://avatars.githubusercontent.com/u/1691023?v=3","gravatar_id":"","url":"https://api.github.com/users/ambiata","html_url":"https://github.com/ambiata","followers_url":"https://api.github.com/users/ambiata/followers","following_url":"https://api.github.com/users/ambiata/following{/other_user}","gists_url":"https://api.github.com/users/ambiata/gists{/gist_id}","starred_url":"https://api.github.com/users/ambiata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ambiata/subscriptions","organizations_url":"https://api.github.com/users/ambiata/orgs","repos_url":"https://api.github.com/users/ambiata/repos","events_url":"https://api.github.com/users/ambiata/events{/privacy}","received_events_url":"https://api.github.com/users/ambiata/received_events","type":"Organization","site_admin":false},"repo":{"id":26213543,"name":"disorder","full_name":"ambiata/disorder","owner":{"login":"ambiata","id":1691023,"avatar_url":"https://avatars.githubusercontent.com/u/1691023?v=3","gravatar_id":"","url":"https://api.github.com/users/ambiata","html_url":"https://github.com/ambiata","followers_url":"https://api.github.com/users/ambiata/followers","following_url":"https://api.github.com/users/ambiata/following{/other_user}","gists_url":"https://api.github.com/users/ambiata/gists{/gist_id}","starred_url":"https://api.github.com/users/ambiata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ambiata/subscriptions","organizations_url":"https://api.github.com/users/ambiata/orgs","repos_url":"https://api.github.com/users/ambiata/repos","events_url":"https://api.github.com/users/ambiata/events{/privacy}","received_events_url":"https://api.github.com/users/ambiata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ambiata/disorder","description":"A small collection of scalacheck generators.","fork":false,"url":"https://api.github.com/repos/ambiata/disorder","forks_url":"https://api.github.com/repos/ambiata/disorder/forks","keys_url":"https://api.github.com/repos/ambiata/disorder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ambiata/disorder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ambiata/disorder/teams","hooks_url":"https://api.github.com/repos/ambiata/disorder/hooks","issue_events_url":"https://api.github.com/repos/ambiata/disorder/issues/events{/number}","events_url":"https://api.github.com/repos/ambiata/disorder/events","assignees_url":"https://api.github.com/repos/ambiata/disorder/assignees{/user}","branches_url":"https://api.github.com/repos/ambiata/disorder/branches{/branch}","tags_url":"https://api.github.com/repos/ambiata/disorder/tags","blobs_url":"https://api.github.com/repos/ambiata/disorder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ambiata/disorder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ambiata/disorder/git/refs{/sha}","trees_url":"https://api.github.com/repos/ambiata/disorder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ambiata/disorder/statuses/{sha}","languages_url":"https://api.github.com/repos/ambiata/disorder/languages","stargazers_url":"https://api.github.com/repos/ambiata/disorder/stargazers","contributors_url":"https://api.github.com/repos/ambiata/disorder/contributors","subscribers_url":"https://api.github.com/repos/ambiata/disorder/subscribers","subscription_url":"https://api.github.com/repos/ambiata/disorder/subscription","commits_url":"https://api.github.com/repos/ambiata/disorder/commits{/sha}","git_commits_url":"https://api.github.com/repos/ambiata/disorder/git/commits{/sha}","comments_url":"https://api.github.com/repos/ambiata/disorder/comments{/number}","issue_comment_url":"https://api.github.com/repos/ambiata/disorder/issues/comments/{number}","contents_url":"https://api.github.com/repos/ambiata/disorder/contents/{+path}","compare_url":"https://api.github.com/repos/ambiata/disorder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ambiata/disorder/merges","archive_url":"https://api.github.com/repos/ambiata/disorder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ambiata/disorder/downloads","issues_url":"https://api.github.com/repos/ambiata/disorder/issues{/number}","pulls_url":"https://api.github.com/repos/ambiata/disorder/pulls{/number}","milestones_url":"https://api.github.com/repos/ambiata/disorder/milestones{/number}","notifications_url":"https://api.github.com/repos/ambiata/disorder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ambiata/disorder/labels{/name}","releases_url":"https://api.github.com/repos/ambiata/disorder/releases{/id}","created_at":"2014-11-05T09:58:00Z","updated_at":"2015-01-02T07:35:13Z","pushed_at":"2015-01-02T07:35:13Z","git_url":"git://github.com/ambiata/disorder.git","ssh_url":"git@github.com:ambiata/disorder.git","clone_url":"https://github.com/ambiata/disorder.git","svn_url":"https://github.com/ambiata/disorder","homepage":null,"size":244,"stargazers_count":1,"watchers_count":1,"language":"Shell","has_issues":true,"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":1,"default_branch":"master"}},"base":{"label":"ambiata:master","ref":"master","sha":"960bd818fceb7b09067cbac9bcd1db9ad5a6b7af","user":{"login":"ambiata","id":1691023,"avatar_url":"https://avatars.githubusercontent.com/u/1691023?v=3","gravatar_id":"","url":"https://api.github.com/users/ambiata","html_url":"https://github.com/ambiata","followers_url":"https://api.github.com/users/ambiata/followers","following_url":"https://api.github.com/users/ambiata/following{/other_user}","gists_url":"https://api.github.com/users/ambiata/gists{/gist_id}","starred_url":"https://api.github.com/users/ambiata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ambiata/subscriptions","organizations_url":"https://api.github.com/users/ambiata/orgs","repos_url":"https://api.github.com/users/ambiata/repos","events_url":"https://api.github.com/users/ambiata/events{/privacy}","received_events_url":"https://api.github.com/users/ambiata/received_events","type":"Organization","site_admin":false},"repo":{"id":26213543,"name":"disorder","full_name":"ambiata/disorder","owner":{"login":"ambiata","id":1691023,"avatar_url":"https://avatars.githubusercontent.com/u/1691023?v=3","gravatar_id":"","url":"https://api.github.com/users/ambiata","html_url":"https://github.com/ambiata","followers_url":"https://api.github.com/users/ambiata/followers","following_url":"https://api.github.com/users/ambiata/following{/other_user}","gists_url":"https://api.github.com/users/ambiata/gists{/gist_id}","starred_url":"https://api.github.com/users/ambiata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ambiata/subscriptions","organizations_url":"https://api.github.com/users/ambiata/orgs","repos_url":"https://api.github.com/users/ambiata/repos","events_url":"https://api.github.com/users/ambiata/events{/privacy}","received_events_url":"https://api.github.com/users/ambiata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ambiata/disorder","description":"A small collection of scalacheck generators.","fork":false,"url":"https://api.github.com/repos/ambiata/disorder","forks_url":"https://api.github.com/repos/ambiata/disorder/forks","keys_url":"https://api.github.com/repos/ambiata/disorder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ambiata/disorder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ambiata/disorder/teams","hooks_url":"https://api.github.com/repos/ambiata/disorder/hooks","issue_events_url":"https://api.github.com/repos/ambiata/disorder/issues/events{/number}","events_url":"https://api.github.com/repos/ambiata/disorder/events","assignees_url":"https://api.github.com/repos/ambiata/disorder/assignees{/user}","branches_url":"https://api.github.com/repos/ambiata/disorder/branches{/branch}","tags_url":"https://api.github.com/repos/ambiata/disorder/tags","blobs_url":"https://api.github.com/repos/ambiata/disorder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ambiata/disorder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ambiata/disorder/git/refs{/sha}","trees_url":"https://api.github.com/repos/ambiata/disorder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ambiata/disorder/statuses/{sha}","languages_url":"https://api.github.com/repos/ambiata/disorder/languages","stargazers_url":"https://api.github.com/repos/ambiata/disorder/stargazers","contributors_url":"https://api.github.com/repos/ambiata/disorder/contributors","subscribers_url":"https://api.github.com/repos/ambiata/disorder/subscribers","subscription_url":"https://api.github.com/repos/ambiata/disorder/subscription","commits_url":"https://api.github.com/repos/ambiata/disorder/commits{/sha}","git_commits_url":"https://api.github.com/repos/ambiata/disorder/git/commits{/sha}","comments_url":"https://api.github.com/repos/ambiata/disorder/comments{/number}","issue_comment_url":"https://api.github.com/repos/ambiata/disorder/issues/comments/{number}","contents_url":"https://api.github.com/repos/ambiata/disorder/contents/{+path}","compare_url":"https://api.github.com/repos/ambiata/disorder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ambiata/disorder/merges","archive_url":"https://api.github.com/repos/ambiata/disorder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ambiata/disorder/downloads","issues_url":"https://api.github.com/repos/ambiata/disorder/issues{/number}","pulls_url":"https://api.github.com/repos/ambiata/disorder/pulls{/number}","milestones_url":"https://api.github.com/repos/ambiata/disorder/milestones{/number}","notifications_url":"https://api.github.com/repos/ambiata/disorder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ambiata/disorder/labels{/name}","releases_url":"https://api.github.com/repos/ambiata/disorder/releases{/id}","created_at":"2014-11-05T09:58:00Z","updated_at":"2015-01-02T07:35:13Z","pushed_at":"2015-01-02T07:35:13Z","git_url":"git://github.com/ambiata/disorder.git","ssh_url":"git@github.com:ambiata/disorder.git","clone_url":"https://github.com/ambiata/disorder.git","svn_url":"https://github.com/ambiata/disorder","homepage":null,"size":244,"stargazers_count":1,"watchers_count":1,"language":"Shell","has_issues":true,"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":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ambiata/disorder/pulls/1"},"html":{"href":"https://github.com/ambiata/disorder/pull/1"},"issue":{"href":"https://api.github.com/repos/ambiata/disorder/issues/1"},"comments":{"href":"https://api.github.com/repos/ambiata/disorder/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/ambiata/disorder/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/ambiata/disorder/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ambiata/disorder/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/ambiata/disorder/statuses/4206b89d893a3bd61b1fd6a83b4c0081b23db8a9"}}}}