]> code.delx.au - gnu-emacs-elpa/blob - packages/realgud/test/test-regexp-ruby.el
15aedbbb9d5165d160aa42e6fcde4d604fd8ca2c
[gnu-emacs-elpa] / packages / realgud / test / test-regexp-ruby.el
1 ;; Don't have a pat-hash for ruby, so we need something that pulls in
2 ;; Ruby.
3 (load-file "./regexp-helper.el")
4 (load-file "../realgud/debugger/rdebug/init.el")
5
6 (test-simple-start)
7
8 (setq bt (gethash "rails-backtrace" realgud-rdebug-pat-hash))
9
10 ;; FIXME: we get a void variable somewhere in here when running
11 ;; even though we define it in lexical-let. Dunno why.
12 ;; setq however will workaround this.
13 (setq text "/tmp/rails-2.3.5/lib/tasks/databases.rake:360")
14
15 (lexical-let ((text "/tmp/rails-2.3.5/lib/tasks/databases.rake:360"))
16
17 (assert-t (numberp (loc-match text bt)) "basic traceback location")
18 (assert-equal "/tmp/rails-2.3.5/lib/tasks/databases.rake"
19 (match-string (realgud-loc-pat-file-group bt)
20 text) "extract traceback file name")
21 (assert-equal "360"
22 (match-string (realgud-loc-pat-line-group bt)
23 text) "extract traceback line number")
24 )
25
26 (let ((text
27 "/tmp/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'"))
28
29 (assert-t (numberp (loc-match text bt)) "traceback location with in")
30 (assert-equal "/tmp/gems/rake-0.8.7/lib/rake.rb"
31 (match-string (realgud-loc-pat-file-group bt)
32 text) "extract traceback file name 2")
33 (assert-equal "597"
34 (match-string (realgud-loc-pat-line-group bt)
35 text) "extract breakpoint line number 2")
36 )
37
38 (end-tests)