[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 0dd37e2 053/215: Revise trepanjs regexps and add regexp te
From: |
Rocky Bernstein |
Subject: |
[elpa] master 0dd37e2 053/215: Revise trepanjs regexps and add regexp test. |
Date: |
Sat, 30 Jul 2016 14:48:53 +0000 (UTC) |
branch: master
commit 0dd37e233f315a5666eefc6a3e9fc088fcc6561f
Author: rocky <address@hidden>
Commit: rocky <address@hidden>
Revise trepanjs regexps and add regexp test.
---
realgud/debugger/trepanjs/init.el | 14 +++---
test/test-regexp-nodejs.el | 4 +-
...st-regexp-nodejs.el => test-regexp-trepanjs.el} | 48 ++++++++++++++------
3 files changed, 44 insertions(+), 22 deletions(-)
diff --git a/realgud/debugger/trepanjs/init.el
b/realgud/debugger/trepanjs/init.el
index decb17d..2111c0b 100644
--- a/realgud/debugger/trepanjs/init.el
+++ b/realgud/debugger/trepanjs/init.el
@@ -56,15 +56,19 @@ realgud-loc-pat struct")
;; (trepanjs):
(setf (gethash "prompt" realgud:trepanjs-pat-hash)
(make-realgud-loc-pat
- :regexp "^(+trepanjs)+ "
+ :regexp (format "^\\(?:%s\\)*(+trepanjs)+ " realgud:js-term-escape)
))
;; Regular expression that describes a "breakpoint set" line
-;; * 4 var count = 0;
+;; For example:
+;; Breakpoint 2 set in file /tmp/gcd.js, line 2.
+;; Breakpoint 3 set in file /usr/lib/nodejs/module.js [module.js], line 380.
(setf (gethash "brkpt-set" realgud:trepanjs-pat-hash)
(make-realgud-loc-pat
- :regexp (format "^Breakpoint %s set in file \\(.+\\), line %s.\n"
- realgud:regexp-captured-num realgud:regexp-captured-num)
+ :regexp (format "^Breakpoint %s set in file %s, line %s.\n"
+ realgud:regexp-captured-num
+ realgud:trepanjs-file-regexp
+ realgud:regexp-captured-num)
:num 1
:file-group 2
:line-group 3))
@@ -137,8 +141,6 @@ realgud-loc-pat struct")
;; We need aliases for step and next because the default would
;; do step 1 and trepanjs doesn't handle this. Or when it does,
;; it will probably look like step(1)
-(setf (gethash "step" realgud:trepanjs-command-hash) "step")
-(setf (gethash "next" realgud:trepanjs-command-hash) "next")
(setf (gethash "eval" realgud:trepanjs-command-hash) "eval('%s')")
(provide-me "realgud:trepanjs-")
diff --git a/test/test-regexp-nodejs.el b/test/test-regexp-nodejs.el
index f05fd8a..48cf922 100644
--- a/test/test-regexp-nodejs.el
+++ b/test/test-regexp-nodejs.el
@@ -51,7 +51,7 @@
(string-match (realgud-cmdbuf-info-loc-regexp test-dbgr) test-text)
(assert-equal "test/fixtures/break-in-module/main.js"
(match-string (realgud-cmdbuf-info-file-group test-dbgr)
- test-text))
+ test-text) "extract file name")
(string-match (realgud-cmdbuf-info-loc-regexp test-dbgr) test-text)
(assert-equal "1"
@@ -60,7 +60,7 @@
test-text) "extract line number")
(note "debugger-backtrace")
-(set (make-local-variable 'test-s1)
+(setq test-text
"#0 module.js:380:17
")
diff --git a/test/test-regexp-nodejs.el b/test/test-regexp-trepanjs.el
similarity index 62%
copy from test/test-regexp-nodejs.el
copy to test/test-regexp-trepanjs.el
index f05fd8a..b0f5266 100644
--- a/test/test-regexp-nodejs.el
+++ b/test/test-regexp-trepanjs.el
@@ -1,5 +1,5 @@
(require 'test-simple)
-(load-file "../realgud/debugger/nodejs/init.el")
+(load-file "../realgud/debugger/trepanjs/init.el")
(load-file "./regexp-helper.el")
(declare-function realgud-cmdbuf-info-loc-regexp 'realgud-buffer-command)
@@ -14,6 +14,7 @@
(declare-function realgud-cmdbuf-info-file-group 'realgud-regexp)
(declare-function realgud-cmdbuf-info-line-group 'realgud-regexp)
(declare-function __FILE__ 'load-relative)
+(declare-function setup-regexp-vars 'regexp-helper)
(test-simple-start)
@@ -22,21 +23,24 @@
(defvar loc-pat)
(defvar bt-pat)
(defvar prompt-pat)
- (defvar realgud:nodejs-pat-hash)
+ (defvar realgud:trepanjs-pat-hash)
(defvar realgud-pat-hash)
+ (defvar helper-bps)
(defvar test-dbgr)
(defvar test-text)
(defvar test-s1)
)
-(note "nodejs prompt matching")
+(setup-regexp-vars realgud:trepanjs-pat-hash)
+
+(note "trepanjs prompt matching")
(set (make-local-variable 'prompt-pat)
- (gethash "prompt" realgud:nodejs-pat-hash))
-(prompt-match "debug> ")
-(prompt-match "[1G[0Jdebug> [8G[1G[0Kconnecting... ok")
+ (gethash "prompt" realgud:trepanjs-pat-hash))
+(prompt-match "(trepanjs) ")
+(prompt-match "[1G[0J(trepanjs) [8G[1G[0Kconnecting... ok")
-(note "nodejs location matching")
-(setq dbg-name "nodejs")
+(note "trepanjs location matching")
+(setq dbg-name "trepanjs")
(setq loc-pat (gethash "loc" (gethash dbg-name realgud-pat-hash)))
(setq test-dbgr (make-realgud-cmdbuf-info
@@ -45,13 +49,13 @@
:file-group (realgud-loc-pat-file-group loc-pat)
:line-group (realgud-loc-pat-line-group loc-pat)))
-(setq test-text "break in test/fixtures/break-in-module/main.js:1\n")
+(setq test-text "break in test/fixtures/break-in-module/main.js at line
1:23\n")
(assert-t (numberp (cmdbuf-loc-match test-text test-dbgr)) "basic location")
(string-match (realgud-cmdbuf-info-loc-regexp test-dbgr) test-text)
(assert-equal "test/fixtures/break-in-module/main.js"
(match-string (realgud-cmdbuf-info-file-group test-dbgr)
- test-text))
+ test-text) "extract file name")
(string-match (realgud-cmdbuf-info-loc-regexp test-dbgr) test-text)
(assert-equal "1"
@@ -59,13 +63,29 @@
(realgud-cmdbuf-info-line-group test-dbgr)
test-text) "extract line number")
-(note "debugger-backtrace")
-(set (make-local-variable 'test-s1)
- "#0 module.js:380:17
+(note "breakpoint location matching")
+
+(setq test-text
+ "Breakpoint 2 set in file /tmp/gcd.js, line 2.
")
+(assert-t (numberp (loc-match test-text helper-bps))
+ "basic breakpoint location")
+(assert-equal "/tmp/gcd.js"
+ (match-string (realgud-loc-pat-file-group helper-bps)
+ test-text) "extract breakpoint file name")
+(assert-equal "2"
+ (match-string (realgud-loc-pat-line-group helper-bps)
+ test-text)
+ "extract breakpoint line number")
+
+(note "debugger-backtrace")
+(setq test-text
+ "##1 in file /tmp/test/gcd.js at line 2:12"
+)
+
(set (make-local-variable
'bt-pat)
- (gethash "debugger-backtrace" realgud:nodejs-pat-hash))
+ (gethash "debugger-backtrace" realgud:trepanjs-pat-hash))
(end-tests)
- [elpa] master 8e1ef01 047/215: core.el: correct trepanjs options, (continued)
- [elpa] master 8e1ef01 047/215: core.el: correct trepanjs options, Rocky Bernstein, 2016/07/30
- [elpa] master 3a84860 040/215: DRY realgud:regexp-capture-num and add more FSF copyrights, Rocky Bernstein, 2016/07/30
- [elpa] master aa3125d 041/215: posix-shell.el: sometimes I can't use (format), Rocky Bernstein, 2016/07/30
- [elpa] master 2598619 039/215: init.el: bracketed short name is optional, Rocky Bernstein, 2016/07/30
- [elpa] master e554cad 027/215: Add trepanjs, Rocky Bernstein, 2016/07/30
- [elpa] master ba7a8b1 045/215: bang on trepanjs and nodejs., Rocky Bernstein, 2016/07/30
- [elpa] master 5f664e2 055/215: Python trepan debuggers include instruction offset in location, Rocky Bernstein, 2016/07/30
- [elpa] master a4f3509 058/215: Add realgud:pdb-remote for remote kinds of pdb execution, e.g. telnet, Rocky Bernstein, 2016/07/30
- [elpa] master 1790056 059/215: Typo: Issue #45, Rocky Bernstein, 2016/07/30
- [elpa] master a016c6f 050/215: Administrivia, Rocky Bernstein, 2016/07/30
- [elpa] master 0dd37e2 053/215: Revise trepanjs regexps and add regexp test.,
Rocky Bernstein <=
- [elpa] master dd0c60a 066/215: I said remove perl5db as an alias, Rocky Bernstein, 2016/07/30
- [elpa] master 0514c68 069/215: Add melpa (nonstable) tag, Rocky Bernstein, 2016/07/30
- [elpa] master bdf317e 060/215: Try flycheck on this file., Rocky Bernstein, 2016/07/30
- [elpa] master 26fd0de 062/215: Show failure in message and in cmdbuf when we fail to invoke a debugger, Rocky Bernstein, 2016/07/30
- [elpa] master 3071b70 065/215: Try cask, Rocky Bernstein, 2016/07/30
- [elpa] master 3b0e42c 067/215: realgud-exec-shell: Make sure we switch to cmdbuf even when there is an, Rocky Bernstein, 2016/07/30
- [elpa] master 2a708cc 068/215: Error on realgud:cmdbuf-associate if you assocate a non-command buffer., Rocky Bernstein, 2016/07/30
- [elpa] master 26369c1 074/215: Typo, Rocky Bernstein, 2016/07/30
- [elpa] master 4a83877 064/215: perl5db alias messes up realgud-track-mode, so drop that name., Rocky Bernstein, 2016/07/30
- [elpa] master d3953ae 092/215: Fix bug in picking out short-key variable name introduced by recent changes, Rocky Bernstein, 2016/07/30