2 (load-file "../realgud/common/buffer/command.el")
3 (load-file "../realgud/debugger/trepan/init.el")
4 (declare-function realgud-cmdbuf-init 'realgud-buffer-command)
10 (defvar realgud-pat-hash)
11 (defvar realgud-cmdbuf-info)
14 (assert-nil (realgud-cmdbuf? (current-buffer))
15 "realgud-cmdbuf? before init")
17 (assert-equal nil (realgud-cmdbuf-command-string (current-buffer))
18 "realgud-cmdbuf-command-string - uninit")
19 (setq temp-cmdbuf (generate-new-buffer "*cmdbuf-test*"))
20 (assert-t (realgud-cmdbuf-init temp-cmdbuf "trepan"
21 (gethash "trepan" realgud-pat-hash))
22 "realgud-cmdbuf-init")
24 (with-current-buffer temp-cmdbuf
25 (switch-to-buffer temp-cmdbuf)
26 (realgud-cmdbuf-info-cmd-args= '("command" "args"))
27 (assert-equal "command args"
28 (realgud-cmdbuf-command-string temp-cmdbuf))
29 (assert-equal "trepan"
30 (realgud-cmdbuf-debugger-name))
32 (realgud-cmdbuf-info-srcbuf-list
34 "srcbuf-list should start out nil")
35 (realgud-cmdbuf-add-srcbuf (current-buffer) temp-cmdbuf)
36 (assert-equal (list (current-buffer))
37 (realgud-cmdbuf-info-srcbuf-list
39 "should have added one item to srcbuf-list")
40 (realgud-cmdbuf-add-srcbuf (current-buffer) temp-cmdbuf)
41 (assert-equal (list (current-buffer))
42 (realgud-cmdbuf-info-srcbuf-list
44 "Second source buffer same as first; should have added still only one item.")
45 (switch-to-buffer nil)