1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-01 11:14:55 +00:00

Add tests for Flymake backends for Ruby and Perl

* test/lisp/progmodes/flymake-tests.el (perl-backend)
(ruby-backend): New tests.
(warning-predicate-rx-perl, warning-predicate-function-perl):
Delete tests.

* test/lisp/progmodes/flymake-resources/test.pl: Include an
error the test file.

* test/lisp/progmodes/flymake-resources/test.rb: file.
This commit is contained in:
João Távora 2017-11-05 12:51:30 +00:00
parent 58e742b21d
commit 58bb3462ee
3 changed files with 20 additions and 14 deletions

View File

@ -1,2 +1,4 @@
@arr = [1,2,3,4];
unknown;
my $b = @arr[1];
[

View File

@ -0,0 +1,5 @@
def bla
return 2
print "not reached"
something
oops

View File

@ -108,24 +108,23 @@ SEVERITY-PREDICATE is used to setup
(should (eq 'flymake-warning
(face-at-point)))))
(ert-deftest warning-predicate-rx-perl ()
"Test perl warning via regular expression predicate."
(ert-deftest perl-backend ()
"Test the perl backend"
(skip-unless (executable-find "perl"))
(flymake-tests--with-flymake
("test.pl" :severity-predicate "^Scalar value")
(flymake-tests--with-flymake ("test.pl")
(flymake-goto-next-error)
(should (eq 'flymake-warning
(face-at-point)))))
(should (eq 'flymake-warning (face-at-point)))
(flymake-goto-next-error)
(should (eq 'flymake-error (face-at-point)))))
(ert-deftest warning-predicate-function-perl ()
"Test perl warning via function predicate."
(skip-unless (executable-find "perl"))
(flymake-tests--with-flymake
("test.pl" :severity-predicate
(lambda (msg) (string-match "^Scalar value" msg)))
(ert-deftest ruby-backend ()
"Test the ruby backend"
(skip-unless (executable-find "ruby"))
(flymake-tests--with-flymake ("test.rb")
(flymake-goto-next-error)
(should (eq 'flymake-warning
(face-at-point)))))
(should (eq 'flymake-warning (face-at-point)))
(flymake-goto-next-error)
(should (eq 'flymake-error (face-at-point)))))
(ert-deftest different-diagnostic-types ()
"Test GCC warning via function predicate."