1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-05-09 02:35:54 +02:00

gnu: emacs-agent-shell: Add tests.

* gnu/packages/patches/emacs-agent-shell-fix-tests.patch: New file.
* gnu/local.mk (dist_patch_DATA): Record it.
* gnu/packages/emacs-xyz (emacs-agent-shell)[source]: Register it.
[arguments]: Add #:test command.
[native-inputs]: Add emacs-ert-runner.

Merges guix/guix!8197

Change-Id: If451a42bf65e534b4dbdce025a47c31ad548cf1a
Signed-off-by: Cayetano Santos <csantosb@inventati.org>
Modified-by: Cayetano Santos <csantosb@inventati.org>
This commit is contained in:
Akiyoshi Suda
2026-05-02 17:18:46 +09:00
committed by Cayetano Santos
parent 0e72fa7d15
commit 090c989656
3 changed files with 45 additions and 1 deletions
+1
View File
@@ -1242,6 +1242,7 @@ dist_patch_DATA = \
%D%/packages/patches/python-treelib-remove-python2-compat.patch \
%D%/packages/patches/elm-offline-package-registry.patch \
%D%/packages/patches/elm-reactor-static-files.patch \
%D%/packages/patches/emacs-agent-shell-fix-tests.patch \
%D%/packages/patches/emacs-deferred-fix-number-of-arguments.patch \
%D%/packages/patches/emacs-disable-jit-compilation.patch \
%D%/packages/patches/emacs-doc-toc-shell-commands.patch \
+12 -1
View File
@@ -1246,8 +1246,19 @@ communicating with LLM agents.")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32 "0njajpz51pbz4hqaq7lcvwaypilq1c9sdxsk6sdxgk1xpivqlxfb"))))
(base32 "0njajpz51pbz4hqaq7lcvwaypilq1c9sdxsk6sdxgk1xpivqlxfb"))
(patches
(search-patches "emacs-agent-shell-fix-tests.patch"))))
(build-system emacs-build-system)
(arguments (list #:test-command
#~(list "ert-runner" "tests"
"-l" "tests/agent-shell-anthropic-tests.el"
"-l" "tests/agent-shell-command-prefix-tests.el"
"-l" "tests/agent-shell-devcontainer-tests.el"
"-l" "tests/agent-shell-diff-tests.el"
"-l" "tests/agent-shell-openai-tests.el"
"-l" "tests/agent-shell-tests.el")))
(native-inputs (list emacs-ert-runner))
(propagated-inputs (list emacs-shell-maker emacs-acp))
(home-page "https://github.com/xenodium/agent-shell")
(synopsis "Native agentic integrations for Claude Code, Gemini CLI, etc")
@@ -0,0 +1,32 @@
From 158304fb31177304d41fe495f8c1cca1fb5cff70 Mon Sep 17 00:00:00 2001
From: xenodium <8107219+xenodium@users.noreply.github.com>
Date: Wed, 25 Mar 2026 12:37:17 +0000
Subject: [PATCH] Fixing test
---
tests/agent-shell-tests.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/agent-shell-tests.el b/tests/agent-shell-tests.el
index f602912d..9263e051 100644
--- a/tests/agent-shell-tests.el
+++ b/tests/agent-shell-tests.el
@@ -1233,14 +1233,16 @@ code block content
test-buffer))
((symbol-function 'shell-maker--process) (lambda () fake-process))
((symbol-function 'shell-maker-finish-output) #'ignore)
+ ((symbol-function 'agent-shell--handle) #'ignore)
(agent-shell-file-completion-enabled nil))
(let* ((shell-buffer (agent-shell--start :config config
:no-focus t
:new-session t))
(subs (map-elt (buffer-local-value 'agent-shell--state shell-buffer)
:event-subscriptions)))
- (should (= 1 (length subs)))
- (should (eq 'turn-complete (map-elt (car subs) :event))))))
+ (should (seq-find (lambda (sub)
+ (eq 'turn-complete (map-elt sub :event)))
+ subs)))))
(remove-hook 'agent-shell-mode-hook hook-fn)
(when (process-live-p fake-process)
(delete-process fake-process))