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/imenu.el
;; Tests for rst-imenu-create-index  -*- lexical-binding: t -*-

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

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

(ert-deftest rst-imenu-create-index ()
  "Tests for `rst-imenu-create-index'."
    (should (ert-equal-buffer-return
	     '(rst-imenu-create-index)
	     "
"
	     t
	     nil))
    (should (ert-equal-buffer-return
	     '(rst-imenu-create-index)
	     "
Some normal text.
"
	     t
	     nil))
    (should (ert-equal-buffer-return
	     '(rst-imenu-create-index)
	     "
Header
======"
	     t
	     '(("=Header" . 2))))
    (should (ert-equal-buffer-return
	     '(rst-imenu-create-index)
	     "
============
  Indented
============"
	     t
	     '(("=Indented=" . 15))))
    (should (ert-equal-buffer-return
	     '(rst-imenu-create-index)
	     "
~~~~~~~~~~~~~~
Over and under
~~~~~~~~~~~~~~"
	     t
	     '(("~Over and under~" . 17))))
    (should (ert-equal-buffer-return
	     '(rst-imenu-create-index)
	     "
Header
======

Subheader
---------"
	     t
	     '(("=Header"
		("=Header" . 2)
		("-Subheader" . 17)))))
    (should (ert-equal-buffer-return
	     '(rst-imenu-create-index)
	     "
Header
======

Subheader
---------

With space
----------"
	     t
	     '(("=Header"
		("=Header" . 2)
		("-Subheader" . 17)
		("-With space" . 38)))))
    (should (ert-equal-buffer-return
	     '(rst-imenu-create-index)
	     "
Header
======

Subheader
---------

With space
----------

Top level again
==============="
	     t
	     '(("=Header"
		("=Header" . 2)
		("-Subheader" . 17)
		("-With space" . 38))
	       ("=Top level again" . 61))))
    (should (ert-equal-buffer-return
	     '(rst-imenu-create-index)
	     "
Header
======

Subheader
---------

With space
----------

Sub sub
~~~~~~~

Top level again
==============="
	     t
	     '(("=Header"
		("=Header" . 2)
		("-Subheader" . 17)
		("-With space"
		 ("-With space" . 38)
		 ("~Sub sub" . 61)))
	       ("=Top level again" . 78))))
    )

;; FIXME: Test missing intermediate sections.
;; FIXME: Test document titles.

Youez - 2016 - github.com/yon3zu
LinuXploit