Closed as not planned
Description
Context
I recently found out that some of our sesman-related tests are not realistic, because they are implemented with the following macro:
(defmacro with-repl-buffer (ses-name type symbol &rest body)
`(with-temp-buffer
(sesman-add-object 'CIDER ,ses-name (current-buffer) t) ;; <------------
...
..that sesman-add-object
does not represent a real call that CIDER performs.
This is highly problematic because by 'hardcoding' this session linking:
- we cannot exercise
cider--sesman-friendly-session-p
, which is a critical function for a functional and fast UX. - some of the tests assert behavior that isn't CIDER's behavior at all.
The latter point is demonstrated by the following test:
cider/test/cider-connection-tests.el
Lines 78 to 100 in 0e56b64
CIDER's real behavior is: when active connections are available, only returns the latest connection if the given buffer is linked to it, or considered friendly to it.
Task
- Make
defmacro with-repl-buffer
more realistic - Adapt affected tests to reflect CIDER's behavior
- Add more direct test coverage to
cider--sesman-friendly-session-p