[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/julia-mode addd3d4 305/352: Merge pull request #81 from Ju
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/julia-mode addd3d4 305/352: Merge pull request #81 from JuliaEditorSupport/tp/add-substitution-tests |
Date: |
Sun, 29 Aug 2021 11:23:07 -0400 (EDT) |
branch: elpa/julia-mode
commit addd3d461b21d83da13331b96f198e908cd9b95e
Merge: b194039 7102542
Author: Tamas K. Papp <tkpapp@gmail.com>
Commit: GitHub <noreply@github.com>
Merge pull request #81 from JuliaEditorSupport/tp/add-substitution-tests
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..cc41fcb 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 (equal (julia--substitute "\\alpha" 7) "α"))
+ ; (should (equal (julia--substitute "\\alpha" 6) "α")) ; BROKEN
+ )
+
+;;;
+;;; run all tests
+;;;
+
(defun julia--run-tests ()
(interactive)
(if (featurep 'ert)
- [nongnu] elpa/julia-mode 1746c4b 238/352: julia-mode: Improve paren indent perf, (continued)
- [nongnu] elpa/julia-mode 1746c4b 238/352: julia-mode: Improve paren indent perf, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 44c9959 241/352: julia-mode: Fix #15461, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 4f56ded 258/352: make lookback distance customizable, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 362be60 255/352: Merge pull request #26 from JeffBezanson/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 6add61b 254/352: fix indenting after commented `end`, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 8818ede 245/352: fix ignoring of keywords inside comments, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 9067194 268/352: Merge pull request #38 from Wilfred/patch-1, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode edaaff2 276/352: Bin op chars (#44), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode c20a4e5 300/352: generate new LaTeX substitutions using 1.3-pre., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode b194039 302/352: Merge pull request #72 from FelipeLema/unicode-for-in, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode addd3d4 305/352: Merge pull request #81 from JuliaEditorSupport/tp/add-substitution-tests,
ELPA Syncer <=
- [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