emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/auctex 01224b6 11/42: Add test for my commit on Aug 18


From: Tassilo Horn
Subject: [elpa] externals/auctex 01224b6 11/42: Add test for my commit on Aug 18
Date: Thu, 23 Nov 2017 06:06:09 -0500 (EST)

branch: externals/auctex
commit 01224b600d1ac47d787b2adfd88071b2a6a5f781
Author: Ikumi Keita <address@hidden>
Commit: Ikumi Keita <address@hidden>

    Add test for my commit on Aug 18
    
    * tests/japanese/parse-timing-test.tex:
    * tests/japanese/parse-timing.el:
    New file.
---
 tests/japanese/parse-timing-test.tex |  2 ++
 tests/japanese/parse-timing.el       | 63 ++++++++++++++++++++++++++++++++++++
 2 files changed, 65 insertions(+)

diff --git a/tests/japanese/parse-timing-test.tex 
b/tests/japanese/parse-timing-test.tex
new file mode 100644
index 0000000..c995cf5
--- /dev/null
+++ b/tests/japanese/parse-timing-test.tex
@@ -0,0 +1,2 @@
+\documentclass{jarticle}
+\usepackage{amsmath}
diff --git a/tests/japanese/parse-timing.el b/tests/japanese/parse-timing.el
new file mode 100644
index 0000000..c9f5243
--- /dev/null
+++ b/tests/japanese/parse-timing.el
@@ -0,0 +1,63 @@
+;;; parse-timing.el --- tests for parse timing
+
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+;; This file is part of AUCTeX.
+
+;; AUCTeX is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; AUCTeX is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with AUCTeX; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+;; 02110-1301, USA.
+
+;;; Commentary:
+;; In AUCTeX, style hooks must not be executed too early.  In
+;; particular, they should not be called within the major mode hook
+;; because the required settings are sometimes not ready at that
+;; timing.  A difficult point is that many AUCTeX functions implicitly
+;; call `TeX-update-style', which eventually calls style hooks.  Thus
+;; a complicated hook sometimes triggers style hooks unintentionally.
+;; Such cases suits for detection via regression tests.
+
+;;; Code:
+
+(require 'ert)
+(require 'tex-jp)
+
+(defun AUCTeX-set-ert-path (&rest sym-val)
+  "Set first element of SYM-VAL to the next one, and so on.
+
+The value is the path to the test file, make sure it is expanded
+in the right directory even when the ERT test from the command
+line and from another directory."
+  (while sym-val
+    (set (pop sym-val)
+        (expand-file-name (pop sym-val)
+                          (when load-file-name
+                            (file-name-directory load-file-name))))))
+(AUCTeX-set-ert-path
+ 'parse-timing
+ "parse-timing-test.tex")
+
+(ert-deftest japanese-TeX-style-hook-timing ()
+  "Test style hooks are not called too early."
+  (let ((TeX-parse-self t)
+       (TeX-master t)
+       (LaTeX-mode-hook '(japanese-latex-mode-initialization
+                          turn-on-reftex)))
+    (find-file parse-timing)
+    (should (memq 'AMSTeX
+                 (get reftex-docstruct-symbol
+                      'reftex-label-alist-style)))
+    (kill-buffer)))
+
+;;; parse-timing.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]