{"action":"created","comment":{"url":"https://api.github.com/repos/gfredericks/test.chuck/pulls/comments/39341488","id":39341488,"diff_hunk":"@@ -0,0 +1,104 @@\n+(ns com.gfredericks.test.chuck.clojure-test\n+  (:require [clojure.test.check :as tc]\n+            [clojure.test.check.properties :as prop\n+             #?@(:cljs [:include-macros true])]\n+            #?(:clj  [clojure.test :refer [is]]\n+               :cljs [cljs.test :refer-macros [is]])))\n+\n+;; copied from clojure.test.check, which privatized the function in\n+;; recent versions.\n+;;\n+;; I think there might be plans for test.check to abstract this logic\n+;; into a protocol or something, so I'm not too bothered by the\n+;; copypasta for now.\n+(defn ^:private not-exception?\n+  [value]\n+  (not (instance? #?(:clj  Throwable\n+                     :cljs js/Error)\n+                  value)))\n+\n+(defn report-exception [result]\n+  (is (not-exception? (:result result)) result))\n+\n+(defn pass? [reports]\n+  (every? #(= (:type %) :pass) reports))\n+\n+(defn report-needed? [reports final-reports]\n+  (or (not (pass? reports)) (empty? final-reports)))\n+\n+(defn save-to-final-reports [final-reports reports]\n+  (if (report-needed? reports final-reports)\n+    reports\n+    final-reports))\n+\n+(def ^:dynamic *chuck-captured-reports*)\n+\n+#?(:cljs\n+(defmethod cljs.test/report [::chuck-capture :fail]\n+  [m]\n+  (swap! *chuck-captured-reports* conj m)))\n+\n+#?(:cljs\n+(defmethod cljs.test/report [::chuck-capture :pass]\n+  [m]\n+  (swap! *chuck-captured-reports* conj m)))\n+\n+(defn capture-reports*\n+  [reports-atom f]\n+  #?(:clj\n+     (binding [clojure.test/report #(swap! reports-atom conj %)]\n+       (f))\n+\n+     :cljs\n+     (binding [*chuck-captured-reports* reports-atom\n+               cljs.test/*current-env* (cljs.test/empty-env ::chuck-capture)]\n+       (f))))\n+\n+(defmacro capture-reports\n+  [& body]\n+  `(let [reports# (atom [])]\n+     (capture-reports* reports# (fn [] ~@body))\n+     @reports#))\n+\n+(defmacro qc-and-report-exception\n+  [final-reports tests bindings & body]\n+  `(report-exception\n+    (tc/quick-check\n+      ~tests\n+      (prop/for-all ~bindings\n+        (let [reports# (capture-reports ~@body)]\n+          (swap! ~final-reports save-to-final-reports reports#)\n+          (pass? reports#))))))\n+\n+(defn -testing\n+  [name func]\n+  (#?(:clj clojure.test/testing :cljs cljs.test/testing) name (func)))\n+\n+(defn -report\n+  [reports]\n+  (#?(:clj clojure.test/report :cljs cljs.test/report) reports))","path":"src/com/gfredericks/test/chuck/clojure_test.cljc","position":null,"original_position":79,"commit_id":"39c3faffbed3e4fb4af8bf219958e5f3bcdde1b0","original_commit_id":"773c76ce7981ad46431e45ad2b329334ddf2e390","user":{"login":"nberger","id":81371,"avatar_url":"https://avatars.githubusercontent.com/u/81371?v=3","gravatar_id":"","url":"https://api.github.com/users/nberger","html_url":"https://github.com/nberger","followers_url":"https://api.github.com/users/nberger/followers","following_url":"https://api.github.com/users/nberger/following{/other_user}","gists_url":"https://api.github.com/users/nberger/gists{/gist_id}","starred_url":"https://api.github.com/users/nberger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nberger/subscriptions","organizations_url":"https://api.github.com/users/nberger/orgs","repos_url":"https://api.github.com/users/nberger/repos","events_url":"https://api.github.com/users/nberger/events{/privacy}","received_events_url":"https://api.github.com/users/nberger/received_events","type":"User","site_admin":false},"body":"Yes. It's done in 39c3faf","created_at":"2015-09-12T21:15:58Z","updated_at":"2015-09-12T21:15:58Z","html_url":"https://github.com/gfredericks/test.chuck/pull/15#discussion_r39341488","pull_request_url":"https://api.github.com/repos/gfredericks/test.chuck/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/gfredericks/test.chuck/pulls/comments/39341488"},"html":{"href":"https://github.com/gfredericks/test.chuck/pull/15#discussion_r39341488"},"pull_request":{"href":"https://api.github.com/repos/gfredericks/test.chuck/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/gfredericks/test.chuck/pulls/15","id":41613286,"html_url":"https://github.com/gfredericks/test.chuck/pull/15","diff_url":"https://github.com/gfredericks/test.chuck/pull/15.diff","patch_url":"https://github.com/gfredericks/test.chuck/pull/15.patch","issue_url":"https://api.github.com/repos/gfredericks/test.chuck/issues/15","number":15,"state":"open","locked":false,"title":"Add ClojureScript support (using cljc)","user":{"login":"nberger","id":81371,"avatar_url":"https://avatars.githubusercontent.com/u/81371?v=3","gravatar_id":"","url":"https://api.github.com/users/nberger","html_url":"https://github.com/nberger","followers_url":"https://api.github.com/users/nberger/followers","following_url":"https://api.github.com/users/nberger/following{/other_user}","gists_url":"https://api.github.com/users/nberger/gists{/gist_id}","starred_url":"https://api.github.com/users/nberger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nberger/subscriptions","organizations_url":"https://api.github.com/users/nberger/orgs","repos_url":"https://api.github.com/users/nberger/repos","events_url":"https://api.github.com/users/nberger/events{/privacy}","received_events_url":"https://api.github.com/users/nberger/received_events","type":"User","site_admin":false},"body":"Alternative version of #14, with bump to clojure 1.7.0 to use reader conditionals.\r\n\r\n### Status\r\n\r\n- [x] test.chuck.properties\r\n- [x] test.chuck.generators (except double & regexes)\r\n- [x] test.chuck.clojure-test\r\n- [x] Implement a better test runner to avoid calling `(run-tests)` in each cljs test ns, and also to run tests in the browser.\r\n- [x] Improve `lein test-all` (and/or add a new \"test\" alias) to compensate the issue of leiningen not picking up `.cljc` files. The namespaces have to be explicitly enumerated. See technomancy/leiningen#1940","created_at":"2015-08-04T20:25:26Z","updated_at":"2015-09-12T21:15:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0df13d678758e665f1bdf4b33a5cdc748379a4e2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gfredericks/test.chuck/pulls/15/commits","review_comments_url":"https://api.github.com/repos/gfredericks/test.chuck/pulls/15/comments","review_comment_url":"https://api.github.com/repos/gfredericks/test.chuck/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gfredericks/test.chuck/issues/15/comments","statuses_url":"https://api.github.com/repos/gfredericks/test.chuck/statuses/39c3faffbed3e4fb4af8bf219958e5f3bcdde1b0","head":{"label":"nberger:cljc","ref":"cljc","sha":"39c3faffbed3e4fb4af8bf219958e5f3bcdde1b0","user":{"login":"nberger","id":81371,"avatar_url":"https://avatars.githubusercontent.com/u/81371?v=3","gravatar_id":"","url":"https://api.github.com/users/nberger","html_url":"https://github.com/nberger","followers_url":"https://api.github.com/users/nberger/followers","following_url":"https://api.github.com/users/nberger/following{/other_user}","gists_url":"https://api.github.com/users/nberger/gists{/gist_id}","starred_url":"https://api.github.com/users/nberger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nberger/subscriptions","organizations_url":"https://api.github.com/users/nberger/orgs","repos_url":"https://api.github.com/users/nberger/repos","events_url":"https://api.github.com/users/nberger/events{/privacy}","received_events_url":"https://api.github.com/users/nberger/received_events","type":"User","site_admin":false},"repo":{"id":40146612,"name":"test.chuck","full_name":"nberger/test.chuck","owner":{"login":"nberger","id":81371,"avatar_url":"https://avatars.githubusercontent.com/u/81371?v=3","gravatar_id":"","url":"https://api.github.com/users/nberger","html_url":"https://github.com/nberger","followers_url":"https://api.github.com/users/nberger/followers","following_url":"https://api.github.com/users/nberger/following{/other_user}","gists_url":"https://api.github.com/users/nberger/gists{/gist_id}","starred_url":"https://api.github.com/users/nberger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nberger/subscriptions","organizations_url":"https://api.github.com/users/nberger/orgs","repos_url":"https://api.github.com/users/nberger/repos","events_url":"https://api.github.com/users/nberger/events{/privacy}","received_events_url":"https://api.github.com/users/nberger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nberger/test.chuck","description":"A utility library for test.check","fork":true,"url":"https://api.github.com/repos/nberger/test.chuck","forks_url":"https://api.github.com/repos/nberger/test.chuck/forks","keys_url":"https://api.github.com/repos/nberger/test.chuck/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nberger/test.chuck/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nberger/test.chuck/teams","hooks_url":"https://api.github.com/repos/nberger/test.chuck/hooks","issue_events_url":"https://api.github.com/repos/nberger/test.chuck/issues/events{/number}","events_url":"https://api.github.com/repos/nberger/test.chuck/events","assignees_url":"https://api.github.com/repos/nberger/test.chuck/assignees{/user}","branches_url":"https://api.github.com/repos/nberger/test.chuck/branches{/branch}","tags_url":"https://api.github.com/repos/nberger/test.chuck/tags","blobs_url":"https://api.github.com/repos/nberger/test.chuck/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nberger/test.chuck/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nberger/test.chuck/git/refs{/sha}","trees_url":"https://api.github.com/repos/nberger/test.chuck/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nberger/test.chuck/statuses/{sha}","languages_url":"https://api.github.com/repos/nberger/test.chuck/languages","stargazers_url":"https://api.github.com/repos/nberger/test.chuck/stargazers","contributors_url":"https://api.github.com/repos/nberger/test.chuck/contributors","subscribers_url":"https://api.github.com/repos/nberger/test.chuck/subscribers","subscription_url":"https://api.github.com/repos/nberger/test.chuck/subscription","commits_url":"https://api.github.com/repos/nberger/test.chuck/commits{/sha}","git_commits_url":"https://api.github.com/repos/nberger/test.chuck/git/commits{/sha}","comments_url":"https://api.github.com/repos/nberger/test.chuck/comments{/number}","issue_comment_url":"https://api.github.com/repos/nberger/test.chuck/issues/comments{/number}","contents_url":"https://api.github.com/repos/nberger/test.chuck/contents/{+path}","compare_url":"https://api.github.com/repos/nberger/test.chuck/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nberger/test.chuck/merges","archive_url":"https://api.github.com/repos/nberger/test.chuck/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nberger/test.chuck/downloads","issues_url":"https://api.github.com/repos/nberger/test.chuck/issues{/number}","pulls_url":"https://api.github.com/repos/nberger/test.chuck/pulls{/number}","milestones_url":"https://api.github.com/repos/nberger/test.chuck/milestones{/number}","notifications_url":"https://api.github.com/repos/nberger/test.chuck/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nberger/test.chuck/labels{/name}","releases_url":"https://api.github.com/repos/nberger/test.chuck/releases{/id}","created_at":"2015-08-03T20:34:25Z","updated_at":"2015-08-03T20:34:25Z","pushed_at":"2015-09-12T21:15:29Z","git_url":"git://github.com/nberger/test.chuck.git","ssh_url":"git@github.com:nberger/test.chuck.git","clone_url":"https://github.com/nberger/test.chuck.git","svn_url":"https://github.com/nberger/test.chuck","homepage":"","size":491,"stargazers_count":0,"watchers_count":0,"language":"Clojure","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":"gfredericks:master","ref":"master","sha":"4b90d75c423182bcce7b522e78305a86c4da50bc","user":{"login":"gfredericks","id":135443,"avatar_url":"https://avatars.githubusercontent.com/u/135443?v=3","gravatar_id":"","url":"https://api.github.com/users/gfredericks","html_url":"https://github.com/gfredericks","followers_url":"https://api.github.com/users/gfredericks/followers","following_url":"https://api.github.com/users/gfredericks/following{/other_user}","gists_url":"https://api.github.com/users/gfredericks/gists{/gist_id}","starred_url":"https://api.github.com/users/gfredericks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfredericks/subscriptions","organizations_url":"https://api.github.com/users/gfredericks/orgs","repos_url":"https://api.github.com/users/gfredericks/repos","events_url":"https://api.github.com/users/gfredericks/events{/privacy}","received_events_url":"https://api.github.com/users/gfredericks/received_events","type":"User","site_admin":false},"repo":{"id":18694088,"name":"test.chuck","full_name":"gfredericks/test.chuck","owner":{"login":"gfredericks","id":135443,"avatar_url":"https://avatars.githubusercontent.com/u/135443?v=3","gravatar_id":"","url":"https://api.github.com/users/gfredericks","html_url":"https://github.com/gfredericks","followers_url":"https://api.github.com/users/gfredericks/followers","following_url":"https://api.github.com/users/gfredericks/following{/other_user}","gists_url":"https://api.github.com/users/gfredericks/gists{/gist_id}","starred_url":"https://api.github.com/users/gfredericks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfredericks/subscriptions","organizations_url":"https://api.github.com/users/gfredericks/orgs","repos_url":"https://api.github.com/users/gfredericks/repos","events_url":"https://api.github.com/users/gfredericks/events{/privacy}","received_events_url":"https://api.github.com/users/gfredericks/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gfredericks/test.chuck","description":"A utility library for test.check","fork":false,"url":"https://api.github.com/repos/gfredericks/test.chuck","forks_url":"https://api.github.com/repos/gfredericks/test.chuck/forks","keys_url":"https://api.github.com/repos/gfredericks/test.chuck/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gfredericks/test.chuck/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gfredericks/test.chuck/teams","hooks_url":"https://api.github.com/repos/gfredericks/test.chuck/hooks","issue_events_url":"https://api.github.com/repos/gfredericks/test.chuck/issues/events{/number}","events_url":"https://api.github.com/repos/gfredericks/test.chuck/events","assignees_url":"https://api.github.com/repos/gfredericks/test.chuck/assignees{/user}","branches_url":"https://api.github.com/repos/gfredericks/test.chuck/branches{/branch}","tags_url":"https://api.github.com/repos/gfredericks/test.chuck/tags","blobs_url":"https://api.github.com/repos/gfredericks/test.chuck/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gfredericks/test.chuck/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gfredericks/test.chuck/git/refs{/sha}","trees_url":"https://api.github.com/repos/gfredericks/test.chuck/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gfredericks/test.chuck/statuses/{sha}","languages_url":"https://api.github.com/repos/gfredericks/test.chuck/languages","stargazers_url":"https://api.github.com/repos/gfredericks/test.chuck/stargazers","contributors_url":"https://api.github.com/repos/gfredericks/test.chuck/contributors","subscribers_url":"https://api.github.com/repos/gfredericks/test.chuck/subscribers","subscription_url":"https://api.github.com/repos/gfredericks/test.chuck/subscription","commits_url":"https://api.github.com/repos/gfredericks/test.chuck/commits{/sha}","git_commits_url":"https://api.github.com/repos/gfredericks/test.chuck/git/commits{/sha}","comments_url":"https://api.github.com/repos/gfredericks/test.chuck/comments{/number}","issue_comment_url":"https://api.github.com/repos/gfredericks/test.chuck/issues/comments{/number}","contents_url":"https://api.github.com/repos/gfredericks/test.chuck/contents/{+path}","compare_url":"https://api.github.com/repos/gfredericks/test.chuck/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gfredericks/test.chuck/merges","archive_url":"https://api.github.com/repos/gfredericks/test.chuck/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gfredericks/test.chuck/downloads","issues_url":"https://api.github.com/repos/gfredericks/test.chuck/issues{/number}","pulls_url":"https://api.github.com/repos/gfredericks/test.chuck/pulls{/number}","milestones_url":"https://api.github.com/repos/gfredericks/test.chuck/milestones{/number}","notifications_url":"https://api.github.com/repos/gfredericks/test.chuck/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gfredericks/test.chuck/labels{/name}","releases_url":"https://api.github.com/repos/gfredericks/test.chuck/releases{/id}","created_at":"2014-04-12T02:09:57Z","updated_at":"2015-09-09T13:22:09Z","pushed_at":"2015-09-12T21:15:29Z","git_url":"git://github.com/gfredericks/test.chuck.git","ssh_url":"git@github.com:gfredericks/test.chuck.git","clone_url":"https://github.com/gfredericks/test.chuck.git","svn_url":"https://github.com/gfredericks/test.chuck","homepage":"","size":1279,"stargazers_count":59,"watchers_count":59,"language":"Clojure","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":3,"forks":7,"open_issues":3,"watchers":59,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gfredericks/test.chuck/pulls/15"},"html":{"href":"https://github.com/gfredericks/test.chuck/pull/15"},"issue":{"href":"https://api.github.com/repos/gfredericks/test.chuck/issues/15"},"comments":{"href":"https://api.github.com/repos/gfredericks/test.chuck/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/gfredericks/test.chuck/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/gfredericks/test.chuck/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gfredericks/test.chuck/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/gfredericks/test.chuck/statuses/39c3faffbed3e4fb4af8bf219958e5f3bcdde1b0"}}}}