                                                (Thread.
                                                  (fn []
                                                    (binding [*out* tmp-out]
-                                                     (sleep 500)
+                                                     (utils/sleep 500)
                                                      (println "Finished."))))
                                                (.start)))
                                            "Started.")}}}
         test-cmd-input ["async-foo"]
-        out-string (test-cli-stdout #(start-cli cli-opts) test-cmd-input)]
-    (is (= (expected-string ["Starting..." "\"Started.\""]) out-string))))
-
-(deftest async-cmd-sleep-finished-test
+        out-string (cli-tests/test-cli-stdout #(cli/start-cli cli-opts) test-cmd-input)]
+    (test/is (= (cli-tests/expected-string ["Starting..." "\"Started.\""]) out-string))))
+
+(test/deftest async-cmd-sleep-finished-test
   (let [cli-opts {:cmds {:async-foo {:fn (fn []
                                            (println "Starting...")
                                            (let [tmp-out *out*]

  ([a b] (+ a b))
  ([a b c] (+ a b c)))

(deftest get-args-info-defns-test
  (let [result (add-args-info-m {:cmds {:a {:fn test-fn-multi-arity}
                                        :b {:fn test-fn-single-arity}}})]
    (is (= '[[a] [a b] [a b c]] (get-in result [:cmds :a :fn-args])))
    (is (= '[[summand1 summand2]] (get-in result [:cmds :b :fn-args])))))

(deftest get-args-info-override-test
  (let [result (add-args-info-m {:cmds {:a {:fn (fn [arg] (inc arg))
                                            :fn-args "My Custom Argument Description"}
                                        :b {:fn (fn [summand1 summand2] (+ summand1 summand2))}}})]
    (is (= "My Custom Argument Description" (get-in result [:cmds :a :fn-args])))
    (is (= '[[summand1 summand2]] (get-in result [:cmds :b :fn-args])))))

(deftest simple-create-arg-hint-completers-test
  (let [cmd-map {:a {:fn-args [['x 'y 'z]]}
                 :b {:fn-args "Test hint"}}
        completers (create-arg-hint-completers cmd-map)]
    (is (vector? completers))
    (is (= 2 (count completers)))))

(deftest create-arg-hint-completers-completion-proposal-test
  (let [cmd-map {:a {:fn-args [['x 'y 'z]]}
                 :b {:fn-args "my args"
                     :completion-hint "test hint"}}
        completers (create-arg-hint-completers cmd-map)
        arr-lst (ArrayList.)]
    (is (= 2 (.complete (nth completers 0) "a " 2 arr-lst)))
    (is (= 2 (.size arr-lst)))
    (is (= "Arguments: [[x y z]]" (.get arr-lst 0)))
    (is (= "" (.get arr-lst 1)))
    (.clear arr-lst)
    (is (= 2 (.complete (nth completers 1) "b " 2 arr-lst)))
    (is (= 2 (.size arr-lst)))
    (is (= "Arguments: my args" (.get arr-lst 0)))
    (is (= "test hint" (.get arr-lst 1)))))

(deftest create-arg-hint-completers-link-hint-test
  (let [cmd-map {:a {:foo "Linking to foo hint test."
                     :completion-hint :foo}}
        completers (create-arg-hint-completers cmd-map)
        arr-lst (ArrayList.)]
    (is (= 2 (.complete (nth completers 0) "a " 2 arr-lst)))
    (is (= 2 (.size arr-lst)))
    (is (= "Linking to foo hint test." (.get arr-lst 0)))
    (is (= "" (.get arr-lst 1)))))



(deftest async-cmd-not-finished-test
  (let [cli-opts {:cmds {:async-foo {:fn (fn []
                                           (println "Starting...")
                                           (let [tmp-out *out*]

              :x :d}
        expected {:a [:b :c :foo]
                  :d [:x :y]}]
    (test/is (= expected (cli/get-cmd-aliases cmds)))))



(test/deftest get-args-info-simple-fns-test
  (let [result (cli/add-args-info-m {:cmds {:a {:fn (fn [arg] (inc arg))}
                                            :b {:fn (fn [summand1 summand2] (+ summand1 summand2))}}})]
    (test/is (= '[[arg]] (get-in result [:cmds :a :fn-args])))
    (test/is (= '[[summand1 summand2]] (get-in result [:cmds :b :fn-args])))))

(test/deftest get-args-info-simple-multi-arity-fn-test
  (let [result (cli/add-args-info-m {:cmds {:a {:fn (fn ([a] (inc a)) ([a b] (+ a b)) ([a b c] (+ a b c)))}}})]
    (test/is (= '[[a] [a b] [a b c]] (get-in result [:cmds :a :fn-args])))))

(defn test-fn-single-arity
  [summand1 summand2]
