mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-05 17:11:41 -05:00
Add tests ein:get-*--nil and fix a bug
This commit is contained in:
parent
3f8f995910
commit
06b1c74a5a
2 changed files with 16 additions and 1 deletions
|
@ -158,7 +158,7 @@ where CELL locates."
|
|||
|
||||
(defun ein:get-kernel--shared-output ()
|
||||
(let ((cell (ein:get-cell-at-point--shared-output)))
|
||||
(when (slot-boundp cell :kernel)
|
||||
(when (and (object-p cell) (slot-boundp cell :kernel))
|
||||
(oref cell :kernel))))
|
||||
|
||||
(defun ein:get-cell-at-point--shared-output ()
|
||||
|
|
|
@ -86,6 +86,21 @@ def func():
|
|||
"Check if `ein:version' can be parsed by `version-to-list'."
|
||||
(version-to-list ein:version))
|
||||
|
||||
|
||||
;; Generic getter
|
||||
|
||||
(defmacro eintest:generic-getter-should-return-nil (func)
|
||||
"In an \"empty\" context, generic getter should return nil."
|
||||
`(ert-deftest ,(intern (format "%s--nil name" func)) ()
|
||||
(with-temp-buffer
|
||||
(should (not (,func))))))
|
||||
|
||||
(eintest:generic-getter-should-return-nil ein:get-url-or-port)
|
||||
(eintest:generic-getter-should-return-nil ein:get-notebook)
|
||||
(eintest:generic-getter-should-return-nil ein:get-kernel)
|
||||
(eintest:generic-getter-should-return-nil ein:get-cell-at-point)
|
||||
(eintest:generic-getter-should-return-nil ein:get-traceback-data)
|
||||
|
||||
|
||||
;;; File name translation
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue