2 (load-file "../realgud/debugger/zshdb/init.el")
3 (load-file "./regexp-helper.el")
7 (setq prompt-pat (gethash "prompt" realgud:zshdb-pat-hash))
8 (setq frame-pat (gethash "debugger-backtrace" realgud:zshdb-pat-hash))
10 (note "zshdb prompt matching")
11 (prompt-match "zshdb<10> " "10")
12 (prompt-match "zshdb<(5)> " "5" "subshell prompt %s")
13 (prompt-match "zshdb<<1>> " "1" "nested debug prompt %s")
15 (note "zshdb frame matching")
17 (note "debugger-backtrace")
19 "->0 in file `/etc/apparmor/functions' at line 24
20 ##1 /etc/apparmor/functions called from file `/etc/init.d/apparmor' at line 35
21 ##2 /etc/init.d/apparmor called from file `/usr/local/bin/zshdb' at line 129
23 (setq frame-re (realgud-loc-pat-regexp frame-pat))
24 (setq num-group (realgud-loc-pat-num frame-pat))
25 (setq file-group (realgud-loc-pat-file-group frame-pat))
26 (setq line-group (realgud-loc-pat-line-group frame-pat))
27 (assert-equal 0 (string-match frame-re s1))
28 (assert-equal "0" (substring s1
29 (match-beginning num-group)
30 (match-end num-group)))
31 (assert-equal "/etc/apparmor/functions"
33 (match-beginning file-group)
34 (match-end file-group)))
37 (match-beginning line-group)
38 (match-end line-group)))
39 (setq pos (match-end 0))
41 (assert-equal 49 (string-match frame-re s1 pos))
42 (assert-equal "1" (substring s1
43 (match-beginning num-group)
44 (match-end num-group)))
45 (assert-equal "/etc/init.d/apparmor"
47 (match-beginning file-group)
48 (match-end file-group)))
51 (match-beginning line-group)
52 (match-end line-group)))
53 (setq pos (match-end 0))
54 (assert-equal 128 (string-match frame-re s1 pos))
55 (assert-equal "2" (substring s1
56 (match-beginning num-group)
57 (match-end num-group)))
58 (assert-equal "/usr/local/bin/zshdb"
60 (match-beginning file-group)
61 (match-end file-group)))
64 (match-beginning line-group)
65 (match-end line-group)))