Skip to content

Commit 083af54

Browse files
timvisher-ddclaude
andcommitted
Fix paren imbalance and duplicate tests from rebase conflict resolution
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent 2ae9853 commit 083af54

2 files changed

Lines changed: 2 additions & 60 deletions

File tree

agent-shell.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5362,7 +5362,7 @@ ACTIONS as per `agent-shell--make-permission-action'."
53625362
(when-let ((tool-calls (map-elt state :tool-calls)))
53635363
(map-put! tool-calls tool-call-id
53645364
(map-insert (map-elt tool-calls tool-call-id)
5365-
:diff-buffer diff-buffer)))))))
5365+
:diff-buffer diff-buffer))))))))
53665366

53675367
(cl-defun agent-shell--make-permission-button (&key text help action keymap navigatable char option)
53685368
"Create a permission button with TEXT, HELP, ACTION, and KEYMAP.

tests/agent-shell-tests.el

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1965,64 +1965,6 @@ code block content
19651965
(should-not responded)
19661966
(should (equal (map-elt state :last-entry-type) "session/request_permission"))))))
19671967

1968-
;;; Tests for agent-shell-show-context-usage-indicator
1969-
1970-
(ert-deftest agent-shell--context-usage-indicator-bar-test ()
1971-
"Test `agent-shell--context-usage-indicator' bar mode."
1972-
(let ((agent-shell--state
1973-
(list (cons :buffer (current-buffer))
1974-
(cons :usage (list (cons :context-used 50000)
1975-
(cons :context-size 200000)
1976-
(cons :total-tokens 50000))))))
1977-
(cl-letf (((symbol-function 'agent-shell--state)
1978-
(lambda () agent-shell--state)))
1979-
(let ((agent-shell-show-context-usage-indicator t))
1980-
(let ((result (agent-shell--context-usage-indicator)))
1981-
(should result)
1982-
(should (= (length (substring-no-properties result)) 1))
1983-
(should (eq (get-text-property 0 'face result) 'success)))))))
1984-
1985-
(ert-deftest agent-shell--context-usage-indicator-detailed-test ()
1986-
"Test `agent-shell--context-usage-indicator' detailed mode."
1987-
(let ((agent-shell--state
1988-
(list (cons :buffer (current-buffer))
1989-
(cons :usage (list (cons :context-used 30000)
1990-
(cons :context-size 200000)
1991-
(cons :total-tokens 30000))))))
1992-
(cl-letf (((symbol-function 'agent-shell--state)
1993-
(lambda () agent-shell--state)))
1994-
(let ((agent-shell-show-context-usage-indicator 'detailed))
1995-
(let ((result (agent-shell--context-usage-indicator)))
1996-
(should result)
1997-
(should (string-match-p "30k/200k" (substring-no-properties result)))
1998-
(should (string-match-p "15%%" (substring-no-properties result)))
1999-
(should (eq (get-text-property 0 'face result) 'success)))))))
2000-
2001-
(ert-deftest agent-shell--context-usage-indicator-detailed-warning-test ()
2002-
"Test `agent-shell--context-usage-indicator' detailed mode with warning face."
2003-
(let ((agent-shell--state
2004-
(list (cons :buffer (current-buffer))
2005-
(cons :usage (list (cons :context-used 140000)
2006-
(cons :context-size 200000)
2007-
(cons :total-tokens 140000))))))
2008-
(cl-letf (((symbol-function 'agent-shell--state)
2009-
(lambda () agent-shell--state)))
2010-
(let ((agent-shell-show-context-usage-indicator 'detailed))
2011-
(let ((result (agent-shell--context-usage-indicator)))
2012-
(should (eq (get-text-property 0 'face result) 'warning)))))))
2013-
2014-
(ert-deftest agent-shell--context-usage-indicator-nil-test ()
2015-
"Test `agent-shell--context-usage-indicator' returns nil when disabled."
2016-
(let ((agent-shell--state
2017-
(list (cons :buffer (current-buffer))
2018-
(cons :usage (list (cons :context-used 50000)
2019-
(cons :context-size 200000)
2020-
(cons :total-tokens 50000))))))
2021-
(cl-letf (((symbol-function 'agent-shell--state)
2022-
(lambda () agent-shell--state)))
2023-
(let ((agent-shell-show-context-usage-indicator nil))
2024-
(should-not (agent-shell--context-usage-indicator))))))
2025-
20261968
;;; Idle notification tests
20271969

20281970
(ert-deftest agent-shell--idle-notification-start-sets-timer-and-hook-test ()
@@ -2119,7 +2061,7 @@ code block content
21192061
(agent-shell--idle-notification-start)
21202062
(should-not (map-elt agent-shell--state :idle-notification-timer))
21212063
(should-not (memq #'agent-shell--idle-notification-cancel
2122-
(buffer-local-value 'post-command-hook (current-buffer)))))))
2064+
(buffer-local-value 'post-command-hook (current-buffer))))))))
21232065

21242066
(ert-deftest agent-shell-alert--detect-terminal-term-program-test ()
21252067
"Test terminal detection via TERM_PROGRAM."

0 commit comments

Comments
 (0)