emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-26 58bb346 4/4: Add tests for Flymake backends for R


From: João Távora
Subject: [Emacs-diffs] emacs-26 58bb346 4/4: Add tests for Flymake backends for Ruby and Perl
Date: Sun, 5 Nov 2017 07:57:18 -0500 (EST)

branch: emacs-26
commit 58bb3462ee5d43efbebba29f8e218391966fb2a1
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    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.
---
 test/lisp/progmodes/flymake-resources/test.pl |  2 ++
 test/lisp/progmodes/flymake-resources/test.rb |  5 +++++
 test/lisp/progmodes/flymake-tests.el          | 27 +++++++++++++--------------
 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 d5abcb4..6f4f1cc 100644
--- a/test/lisp/progmodes/flymake-resources/test.pl
+++ b/test/lisp/progmodes/flymake-resources/test.pl
@@ -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
index 0000000..1419eaf
--- /dev/null
+++ b/test/lisp/progmodes/flymake-resources/test.rb
@@ -0,0 +1,5 @@
+def bla
+  return 2
+  print "not reached"
+  something
+  oops
diff --git a/test/lisp/progmodes/flymake-tests.el 
b/test/lisp/progmodes/flymake-tests.el
index cfa8100..c60f910 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
     (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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]