[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/bnf-mode 6eb06a8 52/74: Make tests easier to read
From: |
Stefan Monnier |
Subject: |
[elpa] externals/bnf-mode 6eb06a8 52/74: Make tests easier to read |
Date: |
Thu, 9 May 2019 08:27:52 -0400 (EDT) |
branch: externals/bnf-mode
commit 6eb06a8cc85cfac2ce639b3c2cb05b42d4a7c895
Author: Serghei Iakovlev <address@hidden>
Commit: Serghei Iakovlev <address@hidden>
Make tests easier to read
---
test/bnf-mode-font-test.el | 184 +++++++++++++++++++++++----------------------
1 file changed, 96 insertions(+), 88 deletions(-)
diff --git a/test/bnf-mode-font-test.el b/test/bnf-mode-font-test.el
index 58fb1f6..6f9b1b7 100644
--- a/test/bnf-mode-font-test.el
+++ b/test/bnf-mode-font-test.el
@@ -38,122 +38,130 @@
(ert-deftest bnf-mode-syntax-table/fontify-strings ()
:tags '(fontification syntax-table)
- (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))))
+ (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))))
(ert-deftest bnf-mode-syntax-table/fontify-line-comment ()
:tags '(fontification syntax-table)
- (bnf-test-with-temp-buffer "; A
+ (bnf-test-with-temp-buffer
+ "; 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-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))))
(ert-deftest bnf-mode-syntax-table/fontify-nonterminals ()
:tags '(fontification syntax-table)
- (bnf-test-with-temp-buffer "<stm> ::= <decl>
+ (bnf-test-with-temp-buffer
+ "<stm> ::= <decl>
angle-brackets ::= are-optional"
- ;; angle bracket
- (should-not (bnf-test-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))
- ;; angle bracket
- (should-not (bnf-test-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))
- ;; angle bracket
- (should-not (bnf-test-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))))
+ ;; angle bracket
+ (should-not (bnf-test-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))
+ ;; angle bracket
+ (should-not (bnf-test-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))
+ ;; angle bracket
+ (should-not (bnf-test-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))))
(ert-deftest bnf-mode-syntax-table/fontify-nonterminals-case ()
:tags '(fontification syntax-table)
- (bnf-test-with-temp-buffer "<RULE> ::= <foo>
+ (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-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))))
(ert-deftest bnf-mode-syntax-table/fontify-nonterminals-start-pos ()
:tags '(fontification syntax-table)
- (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))))
+ (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))))
(ert-deftest bnf-mode-syntax-table/fontify-sequence ()
:tags '(fontification syntax-table)
- (bnf-test-with-temp-buffer "<rule> ::= <foo> <bar> <baz>"
- ;; “<” angle bracket
- (should-not (bnf-test-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))
- ;; “>” angle bracket
- (should-not (bnf-test-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))
- ;; space
- (should-not (bnf-test-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))
- ;; space
- (should-not (bnf-test-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))))
+ (bnf-test-with-temp-buffer
+ "<rule> ::= <foo> <bar> <baz>"
+ ;; "<" angle bracket
+ (should-not (bnf-test-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))
+ ;; ">" angle bracket
+ (should-not (bnf-test-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))
+ ;; space
+ (should-not (bnf-test-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))
+ ;; space
+ (should-not (bnf-test-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))))
(ert-deftest bnf-mode-syntax-table/fontify-alternatives ()
:tags '(fontification syntax-table)
- (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-test-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-test-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))))
+ (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-test-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-test-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))))
(ert-deftest bnf-mode-syntax-table/fontify-rule-punctuation ()
:tags '(fontification syntax-table)
- (bnf-test-with-temp-buffer "
+ (bnf-test-with-temp-buffer
+ "
<proper string> ::=
<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))
- ;; “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))
- ;; “empty”
- (should (eq (bnf-test-face-at 90)
'font-lock-builtin-face))
- (should (eq (bnf-test-face-at 94)
'font-lock-builtin-face))))
+ ;; "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))
+ ;; "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))
+ ;; "empty"
+ (should (eq (bnf-test-face-at 90) 'font-lock-builtin-face))
+ (should (eq (bnf-test-face-at 94) 'font-lock-builtin-face))))
(provide 'bnf-mode-font-test)
;;; bnf-mode-font-test.el ends here
- [elpa] externals/bnf-mode a3a77e3 29/74: In the BNF there are no grouping brackets except angle ones. Fixed, (continued)
- [elpa] externals/bnf-mode a3a77e3 29/74: In the BNF there are no grouping brackets except angle ones. Fixed, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode 1698dc8 39/74: Improved documentation, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode 64a32ba 42/74: Cleaned up Makefile, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode a53ade1 24/74: Fixed BNF rule name definition to follow ALGOL 60 report, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode 65bfadc 65/74: Fixed orthodox comments regexp, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode e2f8bfa 53/74: Added support of ; character to use in terminals, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode 3a46f17 36/74: Correct documentation, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode f99de60 47/74: Cleaned up Makefile, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode 7bbf329 49/74: Added comment-start-skip to help comment commands recognize comments, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode 00a0543 50/74: Removed not used tests macro, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode 6eb06a8 52/74: Make tests easier to read,
Stefan Monnier <=
- [elpa] externals/bnf-mode 273eabd 31/74: Correct change log formatting (II) [ci skip], Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode 687ee9e 16/74: Angle brackets to use for nonterminals are optional. Changed, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode 83f0e0f 28/74: Code cleanup, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode 96c6e76 61/74: Changed CI deploy token [ci skip], Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode 8dabc6c 63/74: Minor correction to the change log format, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode e898672 73/74: Removed no longer needed local variables, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode f95ec5f 69/74: Improved preparing package, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode 7c98cc9 66/74: Fixed misspelling, updated change log, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode ce5005e 57/74: Install missed dependency on Travis CI, Stefan Monnier, 2019/05/09
- [elpa] externals/bnf-mode f00384e 10/74: Change comment syntax, Stefan Monnier, 2019/05/09