Skip to content

Commit

Permalink
test: updated cmd tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lervag committed Apr 29, 2022
1 parent 41d8c1e commit 3c97c9b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
7 changes: 5 additions & 2 deletions test/test-parser-cmds/test-args.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
\documentclass{minimal}
\begin{document}

THIS DOCUMENT DOES NOT COMPILE!

\setmainfont{LucidaBrightOT}[
Extension = .otf,
BoldItalicFont = *-DemiItalic
Expand All @@ -10,11 +12,12 @@
Extension = .otf,
BoldItalicFont = *-DemiItalic
]
\end{helloworld}

\begin{textblock*}{3in}[0,0](3in,1in)
\begin{textblock*}{3in}[0,0] (3in,1in)
Hello world
\end{textblock*}

THIS DOCUMENT DOES NOT COMPILE!
\test \foo(bar)

\end{document}
11 changes: 7 additions & 4 deletions test/test-parser-cmds/test-args.vim
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ silent edit test-args.tex

if empty($INMAKE) | finish | endif

let s:cmd = vimtex#cmd#get_at(4, 1)
let s:cmd = vimtex#cmd#get_at(6, 1)
call assert_equal('LucidaBrightOT', s:cmd.args[0].text)
call assert_match('BoldItalicFont', s:cmd.opts[0].text)

let s:cmd = vimtex#cmd#get_at(9, 1)
let s:cmd = vimtex#cmd#get_at(11, 1)
call assert_equal('helloworld', s:cmd.args[0].text)
call assert_match('BoldItalicFont', s:cmd.opts[0].text)

let s:cmd = vimtex#cmd#get_at(14, 1)
call assert_equal('\begin{textblock*}{3in}[0,0](3in,1in)', s:cmd.text)
let s:cmd = vimtex#cmd#get_at(17, 1)
call assert_equal('\begin{textblock*}{3in}[0,0] (3in,1in)', s:cmd.text)

let s:cmd = vimtex#cmd#get_at(21, 1)
call assert_equal('\test', s:cmd.text)

call vimtex#test#finished()

0 comments on commit 3c97c9b

Please sign in to comment.