From aa60cda2843c2ffb5f7b221f541bba6bb52bc968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Yngve=20Lerv=C3=A5g?= Date: Wed, 14 Dec 2016 21:07:29 +0100 Subject: [PATCH] Cf. #604: Added vader test --- test/vader/fold.vader | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 test/vader/fold.vader diff --git a/test/vader/fold.vader b/test/vader/fold.vader new file mode 100644 index 0000000..ba8e512 --- /dev/null +++ b/test/vader/fold.vader @@ -0,0 +1,33 @@ +Execute (Setup): + let g:vimtex_fold_enabled = 1 + +Given tex (fold: commands): + \documentclass{article} + + \newenvironment{ccd}{% + \begin{centered}\begin{tikzcd}} + {\end{tikzcd}\end{centered}% + } + + \newenvironment{ccd} + {\begin{centered}\begin{tikzcd}} + {\end{tikzcd}\end{centered}} + + % this should not be folded. + \begin{document} + + \end{document} + +Execute (fold: verify): + VimtexReload + AssertEqual foldlevel(1), 1, 'preamble start' + AssertEqual foldlevel(3), 2, 'newenvironment start' + AssertEqual foldlevel(6), 2, 'newenvironment end pre' + AssertEqual foldlevel(7), 1, 'newenvironment end post' + AssertEqual foldlevel(8), 1, 'newenvironment - not folded' + AssertEqual foldlevel(12), 1, 'preamble end pre' + AssertEqual foldlevel(13), 0, 'preamble end post' + +Given: +Execute (Cleanup): + unlet g:vimtex_fold_enabled