]> code.delx.au - gnu-emacs-elpa/blob - packages/realgud/test/test-regexp-pydbgr.el
Add 'packages/realgud/' from commit 'd811316e6a0f4eeee8a1347f504c196c86baa2cb'
[gnu-emacs-elpa] / packages / realgud / test / test-regexp-pydbgr.el
1 (load-file "./regexp-helper.el")
2 (load-file "../realgud/debugger/pydbgr/init.el")
3
4 (test-simple-start)
5
6 (setup-regexp-vars realgud-pydbgr-pat-hash)
7
8 ;; FIXME: we get a void variable somewhere in here when running
9 ;; even though we define it in lexical-let. Dunno why.
10 ;; setq however will workaround this.
11 (setq text " File \"/usr/lib/python2.6/code.py\", line 281, in raw_input")
12
13 (note "traceback location matching")
14 (assert-t (numberp (loc-match text helper-tb)) "basic traceback location")
15 (assert-equal "/usr/lib/python2.6/code.py"
16 (match-string (realgud-loc-pat-file-group helper-tb)
17 text)
18 (format "Failing file group is %s"
19 (realgud-loc-pat-file-group helper-tb) "extract file name"))
20 (assert-equal "281"
21 (match-string (realgud-loc-pat-line-group helper-tb)
22 text) "extract line number")
23
24 (note "breakpoint location matching")
25 (lexical-let ((text "Breakpoint 1 set at line 13 of file /src/git/code/gcd.py"))
26 (assert-t (numberp (loc-match text helper-bps)) "basic breakpoint location")
27 (assert-equal "/src/git/code/gcd.py"
28 (match-string (realgud-loc-pat-file-group helper-bps)
29 text) "extract breakpoint file name")
30 (assert-equal "13"
31 (match-string (realgud-loc-pat-line-group helper-bps)
32 text) "extract breakpoint line number")
33 )
34
35 (note "prompt matching")
36 (lexical-let ((text "(c:\\working\\python\\helloworld.py:30): <module>"))
37 (assert-t (numberp (loc-match text helper-loc)) "MS DOS position location")
38 (assert-equal "c:\\working\\python\\helloworld.py"
39 (match-string (realgud-loc-pat-file-group helper-loc)
40 text)
41 (format "Failing file group is %s"
42 (realgud-loc-pat-file-group helper-tb) "extract file name"))
43 (assert-equal "30"
44 (match-string (realgud-loc-pat-line-group helper-loc)
45 text) "extract line number")
46
47 )
48 (lexical-let ((text "(/usr/bin/ipython:24): <module>"))
49 (assert-t (numberp (loc-match text helper-loc)) "position location")
50 (assert-equal "/usr/bin/ipython"
51 (match-string (realgud-loc-pat-file-group helper-loc)
52 text)
53 (format "Failing file group is %s"
54 (realgud-loc-pat-file-group helper-tb) "extract file name"))
55 (assert-equal "24"
56 (match-string (realgud-loc-pat-line-group helper-loc)
57 text) "extract line number")
58 )
59
60 (lexical-let
61 ((text "(/tmp/eval_stringzDKTfr.py:1 remapped <string>): <module>"))
62 (assert-t (numberp (loc-match text helper-loc)) "position location")
63 (assert-equal "/tmp/eval_stringzDKTfr.py"
64 (match-string (realgud-loc-pat-file-group helper-loc)
65 text)
66 (format "Failing file group is %s"
67 (realgud-loc-pat-file-group helper-tb) "extract file name"))
68 (assert-equal "1"
69 (match-string (realgud-loc-pat-line-group helper-loc)
70 text) "extract line number")
71 )
72
73 (end-tests)