2 (load-file "../realgud/debugger/bashdb/bashdb.el")
3 (load-file "../realgud/common/core.el")
5 (declare-function realgud:expand-file-name-if-exists 'realgud-core)
7 (eval-when-compile (defvar test:run-process-save))
9 (declare-function bashdb-parse-cmd-args 'realgud:bashdb)
10 (declare-function realgud:bashdb 'realgud:bashdb)
11 (declare-function __FILE__ 'require-relative)
15 ;; Save value realgud:run-process and change it to something we want
16 (setq test:run-process-save (symbol-function 'realgud:run-process))
17 (defun realgud:run-process(debugger-name script-filename cmd-args
18 track-mode-func &optional no-reset)
19 "Fake realgud:run-process used in testing"
21 (format "%s %s %s %S" debugger-name script-filename cmd-args
23 (assert-equal "bashdb" debugger-name "debugger name gets passed")
25 (realgud:expand-file-name-if-exists "./gcd.sh")))
26 (assert-equal expanded-name script-filename "file name check")
27 (assert-equal (list "-l" (expand-file-name ".") expanded-name "3" "5")
28 (cdr cmd-args) "command args listified")
29 (assert-equal 'bashdb-track-mode-hook track-mode-func)
32 (note "bashdb-parse-cmd-args")
33 (assert-equal (list nil '("bashdb")
34 (list (realgud:expand-file-name-if-exists "foo")) nil)
35 (bashdb-parse-cmd-args '("bashdb" "foo")))
36 (assert-equal (list nil '("bashdb")
37 (list (realgud:expand-file-name-if-exists "program.sh")
39 (bashdb-parse-cmd-args
40 '("bashdb" "program.sh" "foo")))
42 (realgud:bashdb "bashdb -l . ./gcd.sh 3 5")
43 ;; Restore the old value of realgud:run-process
44 (fset 'realgud:run-process test:run-process-save)