Skip to content

Commit 7739dba

Browse files
author
Bruce Hauman
committed
test: update tests to reflect new error callback behavior
Adjusts test assertions after commit b4778f9 which changed the tool system to only pass 'true' to error callbacks for actual exceptions, not validation/processing errors. Changed 3 assertions from expecting (:error? result) to be true to expecting false, since validation errors now appear in results without triggering MCP-level error callbacks.
1 parent b4778f9 commit 7739dba

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

test/clojure_mcp/other_tools/namespace/tool_test.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197

198198
(testing "list-vars-in-namespace tool execution with invalid namespace"
199199
(let [result (test-tool-execution :list-vars-in-namespace {"namespace" "nonexistent.ns"})]
200-
(is (true? (:error? result)))
200+
(is (false? (:error? result)))
201201
(is (string? (first (:result result))))
202202
(is (str/includes? (first (:result result)) "not found")))))
203203

test/clojure_mcp/tools/eval/tool_test.clj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,17 @@
105105

106106
(testing "Evaluation with error"
107107
(let [result (test-tool-execution "(throw (Exception. \"test error\"))")]
108-
(is (true? (:error? result)))
108+
(is (false? (:error? result)))
109109
(is (= 1 (count (:result result))))
110110
(is (str/includes? (first (:result result)) "test error"))
111111
(is (str/includes? (first (:result result)) "Execution error"))))
112112

113113
(testing "Multiple expressions"
114114
(let [result (test-tool-execution "(println \"first\") (+ 10 20)")]
115115
(is (false? (:error? result)))
116-
(is (= 3 (count (:result result))))
117-
(is (= ["first\n=> nil" "*===============================================*" "=> 30"]
118-
(:result result)))))
116+
(is (= 3 (count (:result result))))
117+
(is (= ["first\n=> nil" "*===============================================*" "=> 30"]
118+
(:result result)))))
119119

120120
(testing "Evaluation with linter warning"
121121
(let [result (test-tool-execution "(let [unused 1] (+ 2 3))")]
@@ -126,7 +126,7 @@
126126

127127
(testing "Evaluation with linter error"
128128
(let [result (test-tool-execution "(def ^:dynamic 1)")]
129-
(is (true? (:error? result)))
129+
(is (false? (:error? result)))
130130
(is (= 1 (count (:result result))))
131131
(is (str/includes? (first (:result result)) "Can't parse")))))
132132

0 commit comments

Comments
 (0)