403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.217.33
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/textproc/py-docutils/work-py39/docutils-0.17.1/tools/editors/emacs/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/textproc/py-docutils/work-py39/docutils-0.17.1/tools/editors/emacs/tests/indent.el
;; Tests for functions around indentation  -*- lexical-binding: t -*-

(add-to-list 'load-path ".")
(load "init" nil t)
(init-rst-ert t)

(ert-deftest indent-asserts ()
  "Check some assertions."
  (should (equal ert-Buf-point-char "\^@"))
  (should (equal ert-Buf-mark-char "\^?"))
  )

(defun indent-for-tab (&optional count)
  "Wrapper to call `indent-for-tab-command' COUNT times defaulting to 1."
  (setq count (or count 1))
  (rst-mode)
  (dotimes (i count)
    (indent-for-tab-command)))

(ert-deftest indent-for-tab-command ()
  "Tests for `indent-for-tab-command'."
  (let ((rst-indent-width 2)
	(rst-indent-field 2)
	(rst-indent-literal-normal 3)
	(rst-indent-literal-minimized 2)
	(rst-indent-comment 3))
    (should (ert-equal-buffer
	     '(indent-for-tab)
	     "\^@"
	     t
	     ))
    (should (ert-equal-buffer
	     '(indent-for-tab)
	     "
* a
\^@"
	     "
* a
  \^@"
	     ))
    (should (ert-equal-buffer
	     '(indent-for-tab)
	     "
* a
  \^@"
	     "
* a
\^@"
	     ))
    (should (ert-equal-buffer
	     '(indent-for-tab)
	     "
* a

* b\^@"
	     "
* a

  * b\^@"
	     ))
    (should (ert-equal-buffer
	     '(indent-for-tab)
	     "
* a

  * b\^@"
	     "
* a

* b\^@"
	     ))
    (should (ert-equal-buffer
	     '(indent-for-tab)
	     "
* a

\^@* b"
	     "
* a

  \^@* b"
	     ))
    (should (ert-equal-buffer
	     '(indent-for-tab)
	     "
* a

  \^@* b"
	     "
* a

\^@* b"
	     ))
    (should (ert-equal-buffer
	     '(indent-for-tab)
	     "
* a
  * b
    XV. c
  * d
* e
\^@"
	     "
* a
  * b
    XV. c
  * d
* e
  \^@"
	     ))
    (should (ert-equal-buffer
	     '(indent-for-tab)
	     "
* a
  * b
    XV. c
  * d
* e
  \^@"
	     "
* a
  * b
    XV. c
  * d
* e
\^@"
	     ))
    (should (ert-equal-buffer
	     '(indent-for-tab)
	     "
* a
  * b
    XV. c
  * d
 * e\^@"
	     "
* a
  * b
    XV. c
  * d
    * e\^@"
	     ))
    (should (ert-equal-buffer
	     '(indent-for-tab)
	     "
* a
  * b
    XV. c
  * d
    * e\^@"
	     "
* a
  * b
    XV. c
  * d
  * e\^@"
	     ))
    (should (ert-equal-buffer
	     '(indent-for-tab)
	     "
* a
  * b
    XV. c
  * d
  * e\^@"
	     "
* a
  * b
    XV. c
  * d
* e\^@"
	     ))
    (should (ert-equal-buffer
	     '(indent-for-tab)
	     "
* a
  * b
    XV. c
  * d
* e\^@"
	     "
* a
  * b
    XV. c
  * d
    * e\^@"
	     ))
    (should (ert-equal-buffer
	     '(indent-for-tab)
	     "
.. [CIT]

     citation

   .. |sub| dir:: Same

        * a

          * b

             :f: val::
                   \^@"
	     "
.. [CIT]

     citation

   .. |sub| dir:: Same

        * a

          * b

             :f: val::
                 \^@"
	     ))
    (should (ert-equal-buffer
	     '(indent-for-tab)
	     "
.. [CIT]

     citation

   .. |sub| dir:: Same

        * a

          * b

             :f: val::
                 \^@"
	     "
.. [CIT]

     citation

   .. |sub| dir:: Same

        * a

          * b

             :f: val::
               \^@"
	     ))
    (should (ert-equal-buffer
	     '(indent-for-tab)
	     "
.. [CIT]

     citation

   .. |sub| dir:: Same

        * a

          * b

             :f: val::
               \^@"
	     "
.. [CIT]

     citation

   .. |sub| dir:: Same

        * a

          * b

             :f: val::
             \^@"
	     ))
    (should (ert-equal-buffer
	     '(indent-for-tab)
	     "
.. [CIT]

     citation

   .. |sub| dir:: Same

        * a

          * b

             :f: val::
             \^@"
	     "
.. [CIT]

     citation

   .. |sub| dir:: Same

        * a

          * b

             :f: val::
            \^@"
	     ))
    (should (ert-equal-buffer
	     '(indent-for-tab)
	     "
.. [CIT]

     citation

   .. |sub| dir:: Same

        * a

          * b

             :f: val::
            \^@"
	     "
.. [CIT]

     citation

   .. |sub| dir:: Same

        * a

          * b

             :f: val::
          \^@"
	     ))
    (should (ert-equal-buffer
	     '(indent-for-tab)
	     "
.. [CIT]

     citation

   .. |sub| dir:: Same

        * a

          * b

             :f: val::
          \^@"
	     "
.. [CIT]

     citation

   .. |sub| dir:: Same

        * a

          * b

             :f: val::
        \^@"
	     ))
    (should (ert-equal-buffer
	     '(indent-for-tab)
	     "
.. [CIT]

     citation

   .. |sub| dir:: Same

        * a

          * b

             :f: val::
        \^@"
	     "
.. [CIT]

     citation

   .. |sub| dir:: Same

        * a

          * b

             :f: val::
      \^@"
	     ))
    (should (ert-equal-buffer
	     '(indent-for-tab)
	     "
.. [CIT]

     citation

   .. |sub| dir:: Same

        * a

          * b

             :f: val::
      \^@"
	     "
.. [CIT]

     citation

   .. |sub| dir:: Same

        * a

          * b

             :f: val::
   \^@"
	     ))
    (should (ert-equal-buffer
	     '(indent-for-tab)
	     "
.. [CIT]

     citation

   .. |sub| dir:: Same

        * a

          * b

             :f: val::
   \^@"
	     "
.. [CIT]

     citation

   .. |sub| dir:: Same

        * a

          * b

             :f: val::
\^@"
	     ))
  ))

(ert-deftest indent-for-tab-command-BUGS ()
  "Exposes bugs for `indent-for-tab-command'."
  :expected-result :failed ;; These are bugs
  (let ((rst-indent-width 2)
	(rst-indent-field 2)
	(rst-indent-literal-normal 3)
	(rst-indent-literal-minimized 2)
	(rst-indent-comment 3))
    ;; Bug https://sourceforge.net/p/docutils/bugs/299/
    (should (ert-equal-buffer
	     '(indent-for-tab)
	     "
Lorem ipsum dolor sit amet, consectetur adipisicing elit
:other:`something` sed do eiusmod tempor incididunt ut
\^@"
	     "
Lorem ipsum dolor sit amet, consectetur adipisicing elit
:other:`something` sed do eiusmod tempor incididunt ut
\^@"
	     ))))

Youez - 2016 - github.com/yon3zu
LinuXploit