]> git.eshelyaron.com Git - emacs.git/commitdiff
Add tests for Flymake backends for Ruby and Perl
authorJoão Távora <joaotavora@gmail.com>
Sun, 5 Nov 2017 12:51:30 +0000 (12:51 +0000)
committerJoão Távora <joaotavora@gmail.com>
Sun, 5 Nov 2017 12:55:43 +0000 (12:55 +0000)
* 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.

test/lisp/progmodes/flymake-resources/test.pl
test/lisp/progmodes/flymake-resources/test.rb [new file with mode: 0644]
test/lisp/progmodes/flymake-tests.el

index d5abcb47e7f6649edd1828adf56cedb472a75b85..6f4f1ccef50fd8b6cd7cb73e29facf3bf30e83ff 100644 (file)
@@ -1,2 +1,4 @@
 @arr = [1,2,3,4];
+unknown;
 my $b = @arr[1];
+[
diff --git a/test/lisp/progmodes/flymake-resources/test.rb b/test/lisp/progmodes/flymake-resources/test.rb
new file mode 100644 (file)
index 0000000..1419eaf
--- /dev/null
@@ -0,0 +1,5 @@
+def bla
+  return 2
+  print "not reached"
+  something
+  oops
index cfa810053ca077e24362e77bf0256727987a1b19..c60f91003456707939fd62f65d392a09f71261a3 100644 (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."