1 (load-file "../realgud/debugger/trepanx/init.el")
2 (load-file "./regexp-helper.el")
6 (set (make-local-variable 'helper-bps)
7 (gethash "brkpt-set" realgud:trepanx-pat-hash))
8 (set (make-local-variable 'prompt)
9 (gethash "prompt" realgud:trepanx-pat-hash))
10 (set (make-local-variable 'helper-tb)
11 (gethash "lang-backtrace" realgud:trepanx-pat-hash))
13 ;; FIXME: we get a void variable somewhere in here when running
14 ;; even though we define it in lexical-let. Dunno why.
15 ;; setq however will workaround this.
16 (set (make-local-variable 'text)
17 "
\e[0;31m Object#boom at tmp/boom.rb:2
\e[0m")
19 (assert-t (numberp (tb-loc-match text))
20 "basic traceback location")
22 (assert-equal 0 (tb-loc-match text)
23 "match trepanx location")
24 (assert-equal "tmp/boom.rb"
25 (match-string (realgud-loc-pat-file-group helper-tb)
27 "extract traceback file name")
29 " { } in main.__script__ at /tmp/blam.rb:5")
30 (assert-equal 0 (tb-loc-match text)
31 "find a trepanx location")
32 (assert-equal "/tmp/blam.rb"
33 (match-string (realgud-loc-pat-file-group helper-tb)
35 "extract traceback file name")
38 (match-string (realgud-loc-pat-line-group helper-tb)
40 "extract traceback line number")
42 (note "prompt matching")
43 (set (make-local-variable 'prompt-pat)
44 (gethash "prompt" realgud:trepanx-pat-hash))
45 (prompt-match "((trepanx)): " nil "nested debugger prompt: %s")
46 (prompt-match "((trepanx@55)): "
47 "@55" "nested debugger prompt with addr: %s")
48 (prompt-match "((trepanx@main)): " "@main"
49 "nested debugger prompt with method: %s")
50 (setq prompt-str "trepanx:")
51 (assert-nil (loc-match prompt-str prompt-pat)
52 (format "invalid prompt %s" prompt-str))
54 (setq text "Set breakpoint 1: __script__() at /bin/irb:2 (@0)")
56 (assert-t (numberp (bp-loc-match text))
57 "basic breakpoint location")
58 (assert-equal "/bin/irb"
59 (match-string (realgud-loc-pat-file-group helper-bps)
61 "extract breakpoint file name"
64 (match-string (realgud-loc-pat-line-group helper-bps)
66 "extract breakpoint line number"