2 (load-file "../realgud/common/buffer/command.el")
3 (load-file "../realgud/debugger/trepan.pl/trepanpl.el")
5 (eval-when-compile (defvar test:run-process-save))
7 (declare-function realgud:trepanpl-parse-cmd-args 'realgud:trepanpl)
8 (declare-function realgud:trepan.pl 'realgud:trepanpl)
9 (declare-function __FILE__ 'require-relative)
13 ;; Save value realgud:run-process and change it to something we want
14 (setq test:run-process-save (symbol-function 'realgud:run-process))
15 (defun realgud:run-process(debugger-name script-filename cmd-args
18 "Fake realgud:run-process used in testing"
20 (format "%s %s %s" debugger-name script-filename cmd-args))
21 (assert-equal "trepan.pl" debugger-name "debugger name gets passed")
22 (let ((expanded-name (expand-file-name "./gcd.pl")))
23 (assert-equal expanded-name script-filename "file name check")
24 (assert-equal (list "-I" (expand-file-name ".") expanded-name "3" "5")
25 (cdr cmd-args) "command args listified")
27 nil ;; Make sure trepanpl doesn't try to do anything with cmdbuf
30 (note "realgud:trepanpl-parse-cmd-args")
31 (assert-equal (list nil '("trepan.pl") '("foo"))
32 (realgud:trepanpl-parse-cmd-args '("trepan.pl" "foo")))
33 (assert-equal (list '("perl5.8") '("trepan.pl") '("foo"))
34 (realgud:trepanpl-parse-cmd-args '("perl5.8" "trepan.pl" "foo")))
35 (assert-equal (list nil '("trepan.pl") '("program.pl" "foo"))
36 (realgud:trepanpl-parse-cmd-args
37 '("trepan.pl" "program.pl" "foo")))
38 (assert-equal (list nil '("trepan.pl") (list (expand-file-name "gcd.pl") "foo"))
39 (realgud:trepanpl-parse-cmd-args
40 '("trepan.pl" "gcd.pl" "foo")))
42 (realgud:trepan.pl "trepanpl -I . ./gcd.pl 3 5")
44 ;; Restore the old value of realgud:run-process
45 (fset 'realgud:run-process test:run-process-save)