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