[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/jade-mode c4014d8a9c 098/128: Merge pull request #50 from
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/jade-mode c4014d8a9c 098/128: Merge pull request #50 from tjefferson08/46_unit_tests |
Date: |
Sat, 29 Jan 2022 08:24:50 -0500 (EST) |
branch: elpa/jade-mode
commit c4014d8a9caf2fb08d4355e65815383af4c42dbc
Merge: a61ad07db6 4336ae9cc4
Author: Travis Jefferson <tjefferson@signpost.com>
Commit: Travis Jefferson <tjefferson@signpost.com>
Merge pull request #50 from tjefferson08/46_unit_tests
#46 unit tests
---
.gitignore | 1 +
.travis.yml | 24 ++++++++++++++++++++++++
Makefile | 4 ++++
jade-mode.el | 8 ++++----
tests/highlight.el | 33 +++++++++++++++++++++++++++++++++
5 files changed, 66 insertions(+), 4 deletions(-)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000..c531d9867f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.elc
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000000..a6c03325f0
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,24 @@
+language: generic
+env:
+ global:
+ - CURL=curl -fsSkL --retry 9 --retry-delay 9
+ matrix:
+ - EMACS=emacs AKA=emacs23
+ - EMACS=emacs24
+# - EMACS=emacs-snapshot
+# matrix:
+# allow_failures:
+# - env: EMACS=emacs-snapshot
+before_install:
+ - sudo add-apt-repository -y ppa:cassou/emacs
+ - sudo apt-get update -qq
+ - sudo apt-get install -qq $EMACS
+install:
+ - if test $EMACS = emacs; then
+ $CURL
https://raw.githubusercontent.com/ohler/ert/fb3c278d/lisp/emacs-lisp/ert.el -o
ert.el;
+ $CURL http://elpa.gnu.org/packages/cl-lib-0.5.el -o cl-lib.el;
+ fi
+script:
+ - make test
+notifications:
+ email: false
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000000..fef3a67f98
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,4 @@
+test:
+ emacs -batch -L . -l ./tests/highlight.el -f
ert-run-tests-batch-and-exit
+# Local Variables:
+# indent-tabs-mode: t
diff --git a/jade-mode.el b/jade-mode.el
index d9d78b8d82..43bc12730d 100644
--- a/jade-mode.el
+++ b/jade-mode.el
@@ -119,7 +119,7 @@
(jade-highlight-js-after-tag 1 font-lock-preprocessor-face)
;; doctype re-overrides some of the fontification rules
- ("!!!\\|doctype[ ]?.*" 0 font-lock-comment-face t)))
+ ("^!!!\\|doctype[ ]?.*" 0 font-lock-comment-face t)))
(defun jade-highlight-js-in-parens (limit)
"Search for a tag declaration (up to LIMIT) which contains a paren
@@ -355,10 +355,10 @@ region defined by BEG and END."
(set (make-local-variable 'comment-start) "//- ")
(set (make-local-variable 'comment-start-skip) "//-\\s-*")
- (setq-default jade-tab-width 2)
- (setq-local indent-line-function 'jade-indent-line)
+ (set (make-local-variable 'jade-tab-width) 2)
+ (set (make-local-variable 'indent-line-function) 'jade-indent-line)
(set (make-local-variable 'indent-region-function) 'jade-indent-region)
- (setq-local indent-tabs-mode nil)
+ (set (make-local-variable 'indent-tabs-mode) nil)
;; keymap
(use-local-map jade-mode-map)
diff --git a/tests/highlight.el b/tests/highlight.el
new file mode 100644
index 0000000000..868d24d953
--- /dev/null
+++ b/tests/highlight.el
@@ -0,0 +1,33 @@
+(require 'ert)
+(require 'jade-mode)
+
+(ert-deftest jade-mode-command-should-be-bound ()
+ (with-temp-buffer
+ (should (fboundp 'jade-mode))
+ (should (null (jade-mode)))))
+
+(ert-deftest jade-mode-highlight-doctype ()
+ (with-temp-buffer
+
+ ;; interesting - if you omit the trailing newline in the string,
+ ;; `font-lock-fontify-buffer' will freak out and fail with
+ ;; end-of-buffer
+ (insert "doctype html\nhtml content\n\n")
+ (jade-mode)
+
+ ;; temp buffers require explict fontification
+ (font-lock-fontify-buffer)
+
+ ;; face at char 1 should be `font-lock-comment-face'
+ (should (eq
+ (get-text-property 1 'face)
+ 'font-lock-comment-face))
+ (goto-char 1)
+
+ ;; face shouldn't change (from `font-lock-comment-face') b/t char
+ ;; 1 and eol
+ (should (=
+ (next-single-property-change (point) 'face)
+ (point-at-eol)))))
+
+
- [nongnu] elpa/jade-mode 275ab149ed 051/128: Merge pull request #11 from jkpl/master, (continued)
- [nongnu] elpa/jade-mode 275ab149ed 051/128: Merge pull request #11 from jkpl/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode d90ad2cc02 036/128: Add syntax table entry for single line comment., ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 05d671fcdb 057/128: Add comment syntax to allow for M-x (un)comment-region., ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 351f756569 083/128: [#37] Highlight string lit. manually - Closes #37, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode a90b512c6e 086/128: [#39] add two functions to hl JS blocks, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 57ab4d6555 085/128: [#39] add JS examples to highlight, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode bbaf2bb3a1 092/128: add a THIRD comment type and use THAT ad default, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 4336ae9cc4 097/128: [#46] ignore .elc files, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 42bb8501b4 099/128: fix some compile warnings and sexp-region, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 0de371694a 053/128: Match zero or more whitespace in BOL instead of one or more., ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode c4014d8a9c 098/128: Merge pull request #50 from tjefferson08/46_unit_tests,
ELPA Syncer <=
- [nongnu] elpa/jade-mode e9288f66dc 106/128: use named regexes in font-lock-keywords list, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode f9522fc00a 105/128: reorder highlight tests to match regex order in jade-mode.el and display, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 97c460453b 116/128: Merge pull request #62 from robbyoconnor/remove-flymake-from-README, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 93c0dec9d4 121/128: fix `.pug` extension to be auto-loaded, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 4dbde92542 122/128: Merge pull request #68 from chillum/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 1ad7c51f3c 128/128: Merge pull request #72 from he-la/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 91c2d4be67 019/128: update to include keybinding information, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode ac71830de7 096/128: [#46] add Makefile and .travis.yml, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode a61ad07db6 094/128: Merge pull request #42 from tjefferson08/doctype_fontification, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 5752db7c36 012/128: added significant whitespace mode as sub-mode for jade-mode and (soon to be) stylus-mode, ELPA Syncer, 2022/01/29