 (def tests-in-set 50)
 (def current-test (atom -1))
 
+(defn- compare-images [expected actual difference]
+  (let [{:keys [err]} (sh/sh "compare" "-metric" "mae" expected actual difference)
+        result        (second (re-find #"\((.*)\)" err))]
+    (edn/read-string result)))
+
+(defn- replace-suffix [file-name suffix]
+  (string/replace file-name #"(\w+)\.(\w+)$" (str suffix ".$2")))
+
 (defn assert-unchanged-snippet-output [name]
   (when-not (contains? #{"current-frame-rate-target-frame-rate"
                          "noise"

(ns quil.snippet
  (:require [quil.core :as q]
            [quil.snippets.all-snippets :as as]
            [clojure.java.io :as io]
            [clojure.test :as t :refer [is]]
            [clojure.string :as cstr]
            clojure.pprint))

(def default-size [500 500])

     :on-close #(deliver result nil))
    (t/is (nil? @result))))

(defn define-snippet-as-test [{:keys [ns name opts setup body] :as snippet}]
  (let [test-name (str (string/replace ns "." "_")
                       "_"
                       name)]
    (intern 'quil.snippet
