+(require 'test-simple)
(load-file "./regexp-helper.el")
+(load-file "../realgud/common/regexp.el")
(load-file "../realgud/debugger/gub/init.el")
+(declare-function realgud-cmdbuf-info-loc-regexp 'realgud-buffer-command)
+(declare-function cmdbuf-loc-match 'realgud-regexp)
+(declare-function realgud-loc-pat-regexp 'realgud-regexp)
+(declare-function realgud-loc-pat-file-group 'realgud-regexp)
+(declare-function realgud-loc-pat-line-group 'realgud-regexp)
+(declare-function realgud-cmdbuf-info-file-group 'realgud-regexp)
+(declare-function realgud-cmdbuf-info-line-group 'realgud-regexp)
+(declare-function realgud-cmdbuf-info 'realgud-regexp)
+(declare-function make-realgud-cmdbuf-info 'realgud-regexp)
+
(test-simple-start)
(eval-when-compile
(defvar dbg-name)
+ (defvar realgud-pat-hash)
(defvar loc-pat)
- (defvar dbgr)
- (defvar text)
+ (defvar test-dbgr)
+ (defvar test-text)
)
;; Some setup usually done in setting up the buffer.
(setq dbg-name "gub")
(setq loc-pat (gethash "loc" (gethash dbg-name realgud-pat-hash)))
-(setq dbgr (make-realgud-cmdbuf-info
- :debugger-name dbg-name
- :loc-regexp (realgud-loc-pat-regexp loc-pat)
- :file-group (realgud-loc-pat-file-group loc-pat)
- :line-group (realgud-loc-pat-line-group loc-pat)))
+(setq test-dbgr (make-realgud-cmdbuf-info
+ :debugger-name dbg-name
+ :loc-regexp (realgud-loc-pat-regexp loc-pat)
+ :file-group (realgud-loc-pat-file-group loc-pat)
+ :line-group (realgud-loc-pat-line-group loc-pat)))
-(setq text "interp/testdata/square.go:15:6")
-(assert-t (numberp (cmdbuf-loc-match text dbgr)) "basic location")
+(setq test-text "interp/testdata/square.go:15:6")
+(assert-t (numberp (cmdbuf-loc-match test-text test-dbgr)) "basic location")
(note "extract file name")
-(assert-equal 0 (cmdbuf-loc-match text dbgr))
+(assert-equal 0 (cmdbuf-loc-match test-text test-dbgr))
(assert-equal "interp/testdata/square.go"
- (match-string (realgud-cmdbuf-info-file-group dbgr)
- text))
+ (match-string (realgud-cmdbuf-info-file-group test-dbgr)
+ test-text))
(assert-equal "15"
(match-string
- (realgud-cmdbuf-info-line-group dbgr)
- text) "extract line number")
+ (realgud-cmdbuf-info-line-group test-dbgr)
+ test-text) "extract line number")
-(setq text " interp/testdata/square.go:15:6")
-(assert-nil (numberp (cmdbuf-loc-match text dbgr)) "location starts with blank")
+(setq test-text " interp/testdata/square.go:15:6")
+(assert-nil (numberp (cmdbuf-loc-match test-text test-dbgr))
+ "location starts with blank")
(end-tests)