Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: aa1acd585a
Fetching contributors…

Cannot retrieve contributors at this time

19 lines (17 sloc) 0.737 kB
(ns clj-commons-exec.test.core
(:require [clj-commons-exec :as exec])
(:use [clojure.test]))
(deftest test-sh
(is (= @(exec/sh ["cat"] {:in "hello world"})
{:exit 0, :out "hello world", :err nil}))
(is (= @(exec/sh ["echo" "hello world"])
{:exit 0, :out "hello world\n", :err nil}))
(is (= @(exec/sh ["echo" "hello world"] {:handle-quoting? true})
{:exit 0, :out "\"hello world\"\n", :err nil}))
(let [{:keys [exit exception]} @(exec/sh ["sleep" "1"] {:watchdog 100})]
(is (= 143 exit))
(is exception)))
(deftest test-sh-pipe
(is (= (map deref (exec/sh-pipe ["echo" "hello world"] ["cat"]))
[{:exit 0, :out nil, :err nil}
{:exit 0, :out "hello world\n", :err nil}])))
Jump to Line
Something went wrong with that request. Please try again.