[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/julia-mode cb41ae0 303/352: Add unit tests for LaTeX subst
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/julia-mode cb41ae0 303/352: Add unit tests for LaTeX substitution. |
Date: |
Sun, 29 Aug 2021 11:23:06 -0400 (EDT) |
branch: elpa/julia-mode
commit cb41ae0f5d2845b62ca90dcd7c8439668bbcfbcc
Author: Tamas K. Papp <tkpapp@gmail.com>
Commit: Tamas K. Papp <tkpapp@gmail.com>
Add unit tests for LaTeX substitution.
---
julia-mode-tests.el | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/julia-mode-tests.el b/julia-mode-tests.el
index f5436c7..06156d6 100644
--- a/julia-mode-tests.el
+++ b/julia-mode-tests.el
@@ -515,7 +515,7 @@ y*y" 'beginning-of-defun "y\\*y" 1 nil 2))
"macro current_module()
return VERSION >= v\"0.7-\" :(@__MODULE__) : :(current_module())))
end" 'beginning-of-defun "@" 1))
-
+
(ert-deftest julia--test-beginning-of-defun-1 ()
"Point moves to beginning of defun in 'function's."
(julia--should-move-point
@@ -595,6 +595,32 @@ end
return fact(x)
end" 'end-of-defun "n == 0" "return fact(x)[ \n]+end" 'end 2))
+;;;
+;;; substitution tests
+;;;
+
+(defun julia--substitute (contents position)
+ "Call LaTeX subsitution in a buffer with `contents' at point
+`position', and return the resulting buffer."
+ (with-temp-buffer
+ (julia-mode)
+ (insert contents)
+ (goto-char position)
+ (julia-latexsub)
+ (buffer-string)))
+
+(ert-deftest julia--test-substitutions ()
+ (should (equal (julia--substitute "\\alpha " 7) "α "))
+ (should (equal (julia--substitute "x\\alpha " 8) "xα "))
+ (should (equal (julia--substitute "\\kappa\\alpha(" 13) "\\kappaα("))
+ ; (should (eq (julia--substitute "\\alpha" 7) "α")) ; BROKEN
+ ; (should (eq (julia--substitute "\\alpha" 6) "α")) ; BROKEN
+ )
+
+;;;
+;;; run all tests
+;;;
+
(defun julia--run-tests ()
(interactive)
(if (featurep 'ert)
- [nongnu] elpa/julia-mode 9df3a7e 307/352: fix variable renaming, (continued)
- [nongnu] elpa/julia-mode 9df3a7e 307/352: fix variable renaming, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 1b8682b 308/352: fix travis setup, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 43cfc91 109/352: Update mailmap, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 7304a4a 166/352: rename None to Union(), and Nothing to Void. fixes #8423, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode e22219f 266/352: Added another test., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 2486d1e 247/352: Replace {UTF8, ASCII, Byte}String with String, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode d3366f4 250/352: Added using, fixed bugs, added tests., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 0e3217f 243/352: Enable travis on emacs23, emacs24, emacs-snapshot., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode c9d8ca6 265/352: Fix backslash character class., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 46d2469 272/352: Merge pull request #39 from rfourquet/rf/where, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode cb41ae0 303/352: Add unit tests for LaTeX substitution.,
ELPA Syncer <=
- [nongnu] elpa/julia-mode df2ab77 319/352: test on Emacs25, simplify setup code (#95), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 5238f9a 323/352: Increase lookback. (#98), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 7de3b0c 330/352: Remove highlighting for :: and <:. (#112), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 1c122f1 328/352: Fix multiple type face highlighting. Add tests. (#110), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 6e9e60b 327/352: Fix forloop matching on == instead of = (#105), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode ac22747 178/352: remove trailing ws from repo, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode c3d3e3a 182/352: Don't call parse-partial-sexp to find the last opening paren., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode c45c786 335/352: Add more tests, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 549a7b4 341/352: Remove C_NULL from constants and add Cvoid, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 13a3c53 344/352: Merge branch 'master' into triple-quote-cmd, ELPA Syncer, 2021/08/29