|
151 | 151 | config {:toolCall {:shellCommand {:summaryMaxLength 80}}} |
152 | 152 | db {:workspace-folders [{:uri (h/file-uri "file:///project/foo") :name "foo"}]}] |
153 | 153 | (testing "strips cd prefix when path matches a workspace root" |
154 | | - (is (= "Running 'clojure -M:test'" |
| 154 | + (is (= "$ clojure -M:test" |
155 | 155 | (summary-fn {:args {"command" (str "cd " (h/file-path "/project/foo") " && clojure -M:test")} |
156 | 156 | :config config |
157 | 157 | :db db})))) |
158 | 158 | (testing "strips cd prefix with semicolon separator" |
159 | | - (is (= "Running 'clojure -M:test'" |
| 159 | + (is (= "$ clojure -M:test" |
160 | 160 | (summary-fn {:args {"command" (str "cd " (h/file-path "/project/foo") " ; clojure -M:test")} |
161 | 161 | :config config |
162 | 162 | :db db})))) |
163 | 163 | (testing "does not strip cd prefix when path is not a workspace root" |
164 | | - (is (= (format "Running 'cd %s && clojure -M:test'" (h/file-path "/other/dir")) |
| 164 | + (is (= (format "$ cd %s && clojure -M:test" (h/file-path "/other/dir")) |
165 | 165 | (summary-fn {:args {"command" (str "cd " (h/file-path "/other/dir") " && clojure -M:test")} |
166 | 166 | :config config |
167 | 167 | :db db})))) |
168 | 168 | (testing "handles command without cd prefix" |
169 | | - (is (= "Running 'ls -la'" |
| 169 | + (is (= "$ ls -la" |
170 | 170 | (summary-fn {:args {"command" "ls -la"} |
171 | 171 | :config config |
172 | 172 | :db db})))) |
173 | 173 | (testing "handles no command argument" |
174 | | - (is (= "Running shell command" |
| 174 | + (is (= "Preparing shell command" |
175 | 175 | (summary-fn {:args {} |
176 | 176 | :config config |
177 | 177 | :db db})))) |
178 | 178 | (testing "truncates long commands" |
179 | | - (is (= "Running 'aaaaaaaaaa...'" |
| 179 | + (is (= "$ aaaaaaaaaa..." |
180 | 180 | (summary-fn {:args {"command" "aaaaaaaaaaaaaaaaaaa"} |
181 | 181 | :config {:toolCall {:shellCommand {:summaryMaxLength 10}}} |
182 | 182 | :db db})))) |
183 | 183 | (testing "handles nil db gracefully" |
184 | | - (is (= (format "Running 'cd %s && clojure -M:test'" (h/file-path "/project/foo")) |
| 184 | + (is (= (format "$ cd %s && clojure -M:test" (h/file-path "/project/foo")) |
185 | 185 | (summary-fn {:args {"command" (str "cd " (h/file-path "/project/foo") " && clojure -M:test")} |
186 | 186 | :config config |
187 | 187 | :db nil})))))) |
0 commit comments