aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Távora2017-11-05 12:51:30 +0000
committerJoão Távora2017-11-05 12:55:43 +0000
commit58bb3462ee5d43efbebba29f8e218391966fb2a1 (patch)
tree6df39070946658f83d4520591da1afef9b71d50d
parent58e742b21dcd15f5a00381de3e7179210978ddc9 (diff)
downloademacs-58bb3462ee5d43efbebba29f8e218391966fb2a1.tar.gz
emacs-58bb3462ee5d43efbebba29f8e218391966fb2a1.zip
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.
-rw-r--r--test/lisp/progmodes/flymake-resources/test.pl2
-rw-r--r--test/lisp/progmodes/flymake-resources/test.rb5
-rw-r--r--test/lisp/progmodes/flymake-tests.el27
3 files changed, 20 insertions, 14 deletions
diff --git a/test/lisp/progmodes/flymake-resources/test.pl b/test/lisp/progmodes/flymake-resources/test.pl
index d5abcb47e7f..6f4f1ccef50 100644
--- a/test/lisp/progmodes/flymake-resources/test.pl
+++ b/test/lisp/progmodes/flymake-resources/test.pl
@@ -1,2 +1,4 @@
1@arr = [1,2,3,4]; 1@arr = [1,2,3,4];
2unknown;
2my $b = @arr[1]; 3my $b = @arr[1];
4[
diff --git a/test/lisp/progmodes/flymake-resources/test.rb b/test/lisp/progmodes/flymake-resources/test.rb
new file mode 100644
index 00000000000..1419eaf3ad2
--- /dev/null
+++ b/test/lisp/progmodes/flymake-resources/test.rb
@@ -0,0 +1,5 @@
1def bla
2 return 2
3 print "not reached"
4 something
5 oops
diff --git a/test/lisp/progmodes/flymake-tests.el b/test/lisp/progmodes/flymake-tests.el
index cfa810053ca..c60f9100345 100644
--- a/test/lisp/progmodes/flymake-tests.el
+++ b/test/lisp/progmodes/flymake-tests.el
@@ -108,24 +108,23 @@ SEVERITY-PREDICATE is used to setup
108 (should (eq 'flymake-warning 108 (should (eq 'flymake-warning
109 (face-at-point))))) 109 (face-at-point)))))
110 110
111(ert-deftest warning-predicate-rx-perl () 111(ert-deftest perl-backend ()
112 "Test perl warning via regular expression predicate." 112 "Test the perl backend"
113 (skip-unless (executable-find "perl")) 113 (skip-unless (executable-find "perl"))
114 (flymake-tests--with-flymake 114 (flymake-tests--with-flymake ("test.pl")
115 ("test.pl" :severity-predicate "^Scalar value")
116 (flymake-goto-next-error) 115 (flymake-goto-next-error)
117 (should (eq 'flymake-warning 116 (should (eq 'flymake-warning (face-at-point)))
118 (face-at-point))))) 117 (flymake-goto-next-error)
118 (should (eq 'flymake-error (face-at-point)))))
119 119
120(ert-deftest warning-predicate-function-perl () 120(ert-deftest ruby-backend ()
121 "Test perl warning via function predicate." 121 "Test the ruby backend"
122 (skip-unless (executable-find "perl")) 122 (skip-unless (executable-find "ruby"))
123 (flymake-tests--with-flymake 123 (flymake-tests--with-flymake ("test.rb")
124 ("test.pl" :severity-predicate
125 (lambda (msg) (string-match "^Scalar value" msg)))
126 (flymake-goto-next-error) 124 (flymake-goto-next-error)
127 (should (eq 'flymake-warning 125 (should (eq 'flymake-warning (face-at-point)))
128 (face-at-point))))) 126 (flymake-goto-next-error)
127 (should (eq 'flymake-error (face-at-point)))))
129 128
130(ert-deftest different-diagnostic-types () 129(ert-deftest different-diagnostic-types ()
131 "Test GCC warning via function predicate." 130 "Test GCC warning via function predicate."