emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/bnf-mode 8948987 20/36: Rename bnf-test-face-at => bnf-


From: Stefan Monnier
Subject: [elpa] externals/bnf-mode 8948987 20/36: Rename bnf-test-face-at => bnf-get-face-at
Date: Wed, 17 Mar 2021 18:40:17 -0400 (EDT)

branch: externals/bnf-mode
commit 89489874a048e95a5274ce380288ffbeaccaa485
Author: Serghei Iakovlev <egrep@protonmail.ch>
Commit: Serghei Iakovlev <egrep@protonmail.ch>

    Rename bnf-test-face-at => bnf-get-face-at
---
 test/test-bnf-mode-font-lock.el | 116 ++++++++++++++++++++--------------------
 test/utils.el                   |   2 +-
 2 files changed, 59 insertions(+), 59 deletions(-)

diff --git a/test/test-bnf-mode-font-lock.el b/test/test-bnf-mode-font-lock.el
index 046ef63..7aabae3 100644
--- a/test/test-bnf-mode-font-lock.el
+++ b/test/test-bnf-mode-font-lock.el
@@ -48,10 +48,10 @@
   (it "does not fontify strings"
     (bnf-test-with-temp-buffer
      "<string delimers> ::= \" | ' | ` | ”"
-     (should-not (bnf-test-face-at 23))
-     (should-not (bnf-test-face-at 27))
-     (should-not (bnf-test-face-at 31))
-     (should-not (bnf-test-face-at 35))))
+     (should-not (bnf-get-face-at 23))
+     (should-not (bnf-get-face-at 27))
+     (should-not (bnf-get-face-at 31))
+     (should-not (bnf-get-face-at 35))))
 
   (it "fontify line comments"
     (custom-set-variables '(bnf-mode-algol-comments-style nil))
@@ -59,10 +59,10 @@
      "; A
 
 <stm> ::= <decl> ; foo"
-     (should (eq (bnf-test-face-at 1) 'font-lock-comment-delimiter-face))
-     (should (eq (bnf-test-face-at 3) 'font-lock-comment-face))
-     (should-not (bnf-test-face-at 5))
-     (should (eq (bnf-test-face-at 24) 'font-lock-comment-face))))
+     (should (eq (bnf-get-face-at 1) 'font-lock-comment-delimiter-face))
+     (should (eq (bnf-get-face-at 3) 'font-lock-comment-face))
+     (should-not (bnf-get-face-at 5))
+     (should (eq (bnf-get-face-at 24) 'font-lock-comment-face))))
 
   ;; TODO(sergei): Implement me
   (it "fontify ALGOL comments"
@@ -74,85 +74,85 @@
      "<stm> ::= <decl>
 angle-brackets ::= are-optional"
      ;; angle bracket
-     (should-not (bnf-test-face-at 1))
+     (should-not (bnf-get-face-at 1))
      ;; "stm"
-     (should (eq (bnf-test-face-at 2) 'font-lock-function-name-face))
-     (should (eq (bnf-test-face-at 4) 'font-lock-function-name-face))
+     (should (eq (bnf-get-face-at 2) 'font-lock-function-name-face))
+     (should (eq (bnf-get-face-at 4) 'font-lock-function-name-face))
      ;; angle bracket
-     (should-not (bnf-test-face-at 5))
+     (should-not (bnf-get-face-at 5))
      ;; "::=" symbol
-     (should (eq (bnf-test-face-at 7) 'font-lock-constant-face))
-     (should (eq (bnf-test-face-at 9) 'font-lock-constant-face))
+     (should (eq (bnf-get-face-at 7) 'font-lock-constant-face))
+     (should (eq (bnf-get-face-at 9) 'font-lock-constant-face))
      ;; angle bracket
-     (should-not (bnf-test-face-at 11))
+     (should-not (bnf-get-face-at 11))
      ;; "dec" symbol
-     (should (eq (bnf-test-face-at 12) 'font-lock-builtin-face))
-     (should (eq (bnf-test-face-at 15) 'font-lock-builtin-face))))
+     (should (eq (bnf-get-face-at 12) 'font-lock-builtin-face))
+     (should (eq (bnf-get-face-at 15) 'font-lock-builtin-face))))
 
   (it "fontify nonterminals despite the case"
     (bnf-test-with-temp-buffer
      "<RULE> ::= <foo>
 <RuLe> ::= <foO>"
-     (should (eq (bnf-test-face-at 2) 'font-lock-function-name-face))
-     (should (eq (bnf-test-face-at 5) 'font-lock-function-name-face))
-     (should-not (bnf-test-face-at 17))
-     (should (eq (bnf-test-face-at 19) 'font-lock-function-name-face))
-     (should (eq (bnf-test-face-at 22) 'font-lock-function-name-face))
-     (should-not (bnf-test-face-at 23))
-     (should (eq (bnf-test-face-at 30) 'font-lock-builtin-face))
-     (should (eq (bnf-test-face-at 32) 'font-lock-builtin-face))
-     (should-not (bnf-test-face-at 33))))
+     (should (eq (bnf-get-face-at 2) 'font-lock-function-name-face))
+     (should (eq (bnf-get-face-at 5) 'font-lock-function-name-face))
+     (should-not (bnf-get-face-at 17))
+     (should (eq (bnf-get-face-at 19) 'font-lock-function-name-face))
+     (should (eq (bnf-get-face-at 22) 'font-lock-function-name-face))
+     (should-not (bnf-get-face-at 23))
+     (should (eq (bnf-get-face-at 30) 'font-lock-builtin-face))
+     (should (eq (bnf-get-face-at 32) 'font-lock-builtin-face))
+     (should-not (bnf-get-face-at 33))))
 
   (it "fontify nonterminals despite the indentation"
     (bnf-test-with-temp-buffer
      "   <rule> ::= <foo>"
-     (should-not (bnf-test-face-at 4))
-     (should (eq (bnf-test-face-at 5) 'font-lock-function-name-face))
-     (should (eq (bnf-test-face-at 6) 'font-lock-function-name-face))
-     (should (eq (bnf-test-face-at 7) 'font-lock-function-name-face))
-     (should (eq (bnf-test-face-at 8) 'font-lock-function-name-face))
-     (should-not (bnf-test-face-at 9))))
+     (should-not (bnf-get-face-at 4))
+     (should (eq (bnf-get-face-at 5) 'font-lock-function-name-face))
+     (should (eq (bnf-get-face-at 6) 'font-lock-function-name-face))
+     (should (eq (bnf-get-face-at 7) 'font-lock-function-name-face))
+     (should (eq (bnf-get-face-at 8) 'font-lock-function-name-face))
+     (should-not (bnf-get-face-at 9))))
 
   (it "fontify sequences"
     (bnf-test-with-temp-buffer
      "<rule> ::= <foo> <bar> <baz>"
      ;; "<" angle bracket
-     (should-not (bnf-test-face-at 1))
+     (should-not (bnf-get-face-at 1))
      ;; "rule"
-     (should (eq (bnf-test-face-at 2) 'font-lock-function-name-face))
-     (should (eq (bnf-test-face-at 5) 'font-lock-function-name-face))
+     (should (eq (bnf-get-face-at 2) 'font-lock-function-name-face))
+     (should (eq (bnf-get-face-at 5) 'font-lock-function-name-face))
      ;; ">" angle bracket
-     (should-not (bnf-test-face-at 6))
+     (should-not (bnf-get-face-at 6))
      ;; "foo"
-     (should (eq (bnf-test-face-at 13) 'font-lock-builtin-face))
-     (should (eq (bnf-test-face-at 15) 'font-lock-builtin-face))
+     (should (eq (bnf-get-face-at 13) 'font-lock-builtin-face))
+     (should (eq (bnf-get-face-at 15) 'font-lock-builtin-face))
      ;; space
-     (should-not (bnf-test-face-at 17))
+     (should-not (bnf-get-face-at 17))
      ;; "bar"
-     (should (eq (bnf-test-face-at 19) 'font-lock-builtin-face))
-     (should (eq (bnf-test-face-at 21) 'font-lock-builtin-face))
+     (should (eq (bnf-get-face-at 19) 'font-lock-builtin-face))
+     (should (eq (bnf-get-face-at 21) 'font-lock-builtin-face))
      ;; space
-     (should-not (bnf-test-face-at 23))
+     (should-not (bnf-get-face-at 23))
      ;; "baz"
-     (should (eq (bnf-test-face-at 25) 'font-lock-builtin-face))
-     (should (eq (bnf-test-face-at 27) 'font-lock-builtin-face))))
+     (should (eq (bnf-get-face-at 25) 'font-lock-builtin-face))
+     (should (eq (bnf-get-face-at 27) 'font-lock-builtin-face))))
 
   (it "fontify alternatives"
     (bnf-test-with-temp-buffer
      "<foo> | <bar> | <baz>"
      ;; "foo"
-     (should (eq (bnf-test-face-at 2) 'font-lock-builtin-face))
-     (should (eq (bnf-test-face-at 4) 'font-lock-builtin-face))
+     (should (eq (bnf-get-face-at 2) 'font-lock-builtin-face))
+     (should (eq (bnf-get-face-at 4) 'font-lock-builtin-face))
      ;; "|"
-     (should (eq (bnf-test-face-at 7) 'font-lock-warning-face))
+     (should (eq (bnf-get-face-at 7) 'font-lock-warning-face))
      ;; "bar"
-     (should (eq (bnf-test-face-at 10) 'font-lock-builtin-face))
-     (should (eq (bnf-test-face-at 12) 'font-lock-builtin-face))
+     (should (eq (bnf-get-face-at 10) 'font-lock-builtin-face))
+     (should (eq (bnf-get-face-at 12) 'font-lock-builtin-face))
      ;; "|"
-     (should (eq (bnf-test-face-at 15) 'font-lock-warning-face))
+     (should (eq (bnf-get-face-at 15) 'font-lock-warning-face))
      ;; "baz"
-     (should (eq (bnf-test-face-at 18) 'font-lock-builtin-face))
-     (should (eq (bnf-test-face-at 20) 'font-lock-builtin-face))))
+     (should (eq (bnf-get-face-at 18) 'font-lock-builtin-face))
+     (should (eq (bnf-get-face-at 20) 'font-lock-builtin-face))))
 
   (it "fontify rule punctuation"
     (bnf-test-with-temp-buffer
@@ -161,13 +161,13 @@ angle-brackets ::= are-optional"
         <any sequence of symbols not containing ` or ' >
         | <empty>"
      ;; "proper string"
-     (should (eq (bnf-test-face-at 3) 'font-lock-function-name-face))
-     (should (eq (bnf-test-face-at 15) 'font-lock-function-name-face))
+     (should (eq (bnf-get-face-at 3) 'font-lock-function-name-face))
+     (should (eq (bnf-get-face-at 15) 'font-lock-function-name-face))
      ;; "any sequence of symbols not containing ` or ' "
-     (should (eq (bnf-test-face-at 31) 'font-lock-builtin-face))
-     (should (eq (bnf-test-face-at 76) 'font-lock-builtin-face))
+     (should (eq (bnf-get-face-at 31) 'font-lock-builtin-face))
+     (should (eq (bnf-get-face-at 76) 'font-lock-builtin-face))
      ;; "empty"
-     (should (eq (bnf-test-face-at 90) 'font-lock-builtin-face))
-     (should (eq (bnf-test-face-at 94) 'font-lock-builtin-face)))))
+     (should (eq (bnf-get-face-at 90) 'font-lock-builtin-face))
+     (should (eq (bnf-get-face-at 94) 'font-lock-builtin-face)))))
 
 ;;; test-bnf-mode-font-lock.el ends here
diff --git a/test/utils.el b/test/utils.el
index 8ef5e69..6a2144e 100644
--- a/test/utils.el
+++ b/test/utils.el
@@ -55,7 +55,7 @@
      (unwind-protect
          (progn ,@body))))
 
-(defun bnf-test-face-at (pos &optional content)
+(defun bnf-get-face-at (pos &optional content)
   "Get the face at POS in CONTENT.
 If CONTENT is not given, return the face at POS in the current
 buffer."



reply via email to

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