Browse Source

Add indium-breakpoint-unresolved-p

workspaces
Nicolas Petton 4 years ago
parent
commit
e84a984a7c
2 changed files with 7 additions and 0 deletions
  1. +3
    -0
      indium-structs.el
  2. +4
    -0
      test/unit/indium-structs-test.el

+ 3
- 0
indium-structs.el View File

@ -235,6 +235,9 @@ If LINE is not provided, return all breakpoints in FILE."
(when-let ((ov (indium-breakpoint-overlay breakpoint)))
(overlay-buffer ov)))
(defun indium-breakpoint-unresolved-p (breakpoint)
"Return non-nil if BREAKPOINT is not yet resolved in the runtime."
(null (indium-breakpoint-id breakpoint)))
(provide 'indium-structs)
;;; indium-structs.el ends here

+ 4
- 0
test/unit/indium-structs-test.el View File

@ -112,6 +112,10 @@
(indium-current-connection-add-breakpoint brk)
(expect (indium-current-connection-get-breakpoint 'a) :to-be brk))))
(it "can know if a breakpoint is resolved"
(expect (indium-breakpoint-unresolved-p (make-indium-breakpoint)) :to-be-truthy)
(expect (indium-breakpoint-unresolved-p (make-indium-breakpoint :id 'fake)) :to-be-falsy))
(it "gets nil when no breakpoint found for ID"
(with-indium-connection (make-indium-connection)
(let ((brk (make-indium-breakpoint :id 'a :line 12 :file "foo.js" :condition "cond")))


Loading…
Cancel
Save