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:
parent
58e742b21d
commit
58bb3462ee
3 changed files with 20 additions and 14 deletions
|
@ -1,2 +1,4 @@
|
||||||
@arr = [1,2,3,4];
|
@arr = [1,2,3,4];
|
||||||
|
unknown;
|
||||||
my $b = @arr[1];
|
my $b = @arr[1];
|
||||||
|
[
|
||||||
|
|
5
test/lisp/progmodes/flymake-resources/test.rb
Normal file
5
test/lisp/progmodes/flymake-resources/test.rb
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
def bla
|
||||||
|
return 2
|
||||||
|
print "not reached"
|
||||||
|
something
|
||||||
|
oops
|
|
@ -108,24 +108,23 @@ SEVERITY-PREDICATE is used to setup
|
||||||
(should (eq 'flymake-warning
|
(should (eq 'flymake-warning
|
||||||
(face-at-point)))))
|
(face-at-point)))))
|
||||||
|
|
||||||
(ert-deftest warning-predicate-rx-perl ()
|
(ert-deftest perl-backend ()
|
||||||
"Test perl warning via regular expression predicate."
|
"Test the perl backend"
|
||||||
(skip-unless (executable-find "perl"))
|
(skip-unless (executable-find "perl"))
|
||||||
(flymake-tests--with-flymake
|
(flymake-tests--with-flymake ("test.pl")
|
||||||
("test.pl" :severity-predicate "^Scalar value")
|
|
||||||
(flymake-goto-next-error)
|
(flymake-goto-next-error)
|
||||||
(should (eq 'flymake-warning
|
(should (eq 'flymake-warning (face-at-point)))
|
||||||
(face-at-point)))))
|
(flymake-goto-next-error)
|
||||||
|
(should (eq 'flymake-error (face-at-point)))))
|
||||||
|
|
||||||
(ert-deftest warning-predicate-function-perl ()
|
(ert-deftest ruby-backend ()
|
||||||
"Test perl warning via function predicate."
|
"Test the ruby backend"
|
||||||
(skip-unless (executable-find "perl"))
|
(skip-unless (executable-find "ruby"))
|
||||||
(flymake-tests--with-flymake
|
(flymake-tests--with-flymake ("test.rb")
|
||||||
("test.pl" :severity-predicate
|
|
||||||
(lambda (msg) (string-match "^Scalar value" msg)))
|
|
||||||
(flymake-goto-next-error)
|
(flymake-goto-next-error)
|
||||||
(should (eq 'flymake-warning
|
(should (eq 'flymake-warning (face-at-point)))
|
||||||
(face-at-point)))))
|
(flymake-goto-next-error)
|
||||||
|
(should (eq 'flymake-error (face-at-point)))))
|
||||||
|
|
||||||
(ert-deftest different-diagnostic-types ()
|
(ert-deftest different-diagnostic-types ()
|
||||||
"Test GCC warning via function predicate."
|
"Test GCC warning via function predicate."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue