summaryrefslogtreecommitdiff
path: root/test/src/syntax-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/src/syntax-tests.el')
-rw-r--r--test/src/syntax-tests.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/src/syntax-tests.el b/test/src/syntax-tests.el
index 479b818935f..e4e3054d37a 100644
--- a/test/src/syntax-tests.el
+++ b/test/src/syntax-tests.el
@@ -21,6 +21,7 @@
(require 'ert)
(require 'ert-x)
+(require 'cl-lib)
(ert-deftest parse-partial-sexp-continue-over-comment-marker ()
"Continue a parse that stopped in the middle of a comment marker."
@@ -56,6 +57,16 @@
(should (equal (parse-partial-sexp aftC pointX nil nil pps-aftC)
ppsX)))))
+(ert-deftest syntax-class-character-test ()
+ (cl-loop for char across " .w_()'\"$\\/<>@!|"
+ for i from 0
+ do (should (= char (syntax-class-to-char i)))
+ when (string-to-syntax (string char))
+ do (should (= char (syntax-class-to-char
+ (car (string-to-syntax (string char)))))))
+ (should-error (syntax-class-to-char -1))
+ (should-error (syntax-class-to-char 200)))
+
(ert-deftest parse-partial-sexp-paren-comments ()
"Test syntax parsing with paren comment markers.
Specifically, where the first character of the comment marker is