]> code.delx.au - gnu-emacs-elpa/blob - packages/realgud/test/test-regexp-rdebug.el
Add 'packages/realgud/' from commit 'd811316e6a0f4eeee8a1347f504c196c86baa2cb'
[gnu-emacs-elpa] / packages / realgud / test / test-regexp-rdebug.el
1 (require 'test-simple)
2 (load-file "../realgud/debugger/rdebug/init.el")
3 (load-file "./regexp-helper.el")
4
5 (test-simple-start)
6
7 (setup-regexp-vars realgud-rdebug-pat-hash)
8 (setq rails-bt (gethash "rails-backtrace" realgud-rdebug-pat-hash))
9
10 ;; FIXME: we get a void variable somewhere in here when running
11 ;; even though we define it in lexical-let. Dunno why.
12 ;; setq however will workaround this.
13 (setq text " from /usr/local/bin/irb:12:in `<main>'")
14 (note "traceback location matching")
15 (lexical-let ((text " from /usr/local/bin/irb:12:in `<main>'"))
16 (assert-t (numberp (loc-match text helper-tb)) "basic traceback location")
17 (assert-equal "/usr/local/bin/irb"
18 (match-string (realgud-loc-pat-file-group helper-tb)
19 text)
20 "extract traceback file name")
21 (assert-equal "12"
22 (match-string (realgud-loc-pat-line-group helper-tb)
23 text) "extract traceback line number")
24 )
25
26 (lexical-let ((text "Breakpoint 1 file /usr/bin/irb, line 10\n"))
27 (assert-t (numberp (loc-match text helper-bps)) "basic breakpoint location")
28 (assert-equal "/usr/bin/irb"
29 (match-string (realgud-loc-pat-file-group helper-bps)
30 text) "extract breakpoint file name")
31 (assert-equal "10"
32 (match-string (realgud-loc-pat-line-group helper-bps)
33 text) "extract breakpoint line number")
34 )
35
36 (note "prompt")
37 (set (make-local-variable 'prompt-pat)
38 (gethash "prompt" realgud-rdebug-pat-hash))
39 (prompt-match "(rdb:1) ")
40
41 (end-tests)