Autocommit of file /home/julien/.dotfiles/vim/.vim/bundle/vimtodo/test/test002.vim...
authorJulien Valroff <julien@kirya.net>
Tue, 1 Nov 2011 08:08:07 +0000 (09:08 +0100)
committerJulien Valroff <julien@kirya.net>
Tue, 1 Nov 2011 08:08:07 +0000 (09:08 +0100)
.vim/bundle/vimtodo/test/test002.vim [new file with mode: 0644]

diff --git a/.vim/bundle/vimtodo/test/test002.vim b/.vim/bundle/vimtodo/test/test002.vim
new file mode 100644 (file)
index 0000000..dbb85e2
--- /dev/null
@@ -0,0 +1,48 @@
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Test TODO state changes
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+source setup_tests.inc
+call vimtap#Plan(12)
+
+" Regular expression to match a status timestamp
+let timestampre='\d\{4\}-\d\{2\}-\d\{2\} \d\{2\}:\d\{2\}:\d\{2\}'
+
+insert
+TODO 2009-09-06 Test entry
+.
+
+let line=line('.')
+let entry='2009-09-06 Test entry'
+
+" Single state change
+normal \cs
+call vimtap#Is(getline('.'), 'DONE '.entry,
+            \"State changed to DONE")
+call vimtap#Like(getline(line+1), '^    CLOSED: '.timestampre,
+            \"Added CLOSED: tag")
+call vimtap#Like(getline(line+2), '^    :LOGBOOK:',
+            \"Logbook drawer created")
+call vimtap#Like(getline(line+3), '^        DONE: '.timestampre,
+            \"Log entry added")
+" More state changes
+normal \cs
+call vimtap#Is(getline('.'), 'CANCELLED '.entry,
+            \"State changed to CANCELLED")
+call vimtap#Like(getline(line+1), '^    CLOSED: '.timestampre,
+            \"CLOSED tag present")
+normal \cs
+call vimtap#Is(getline('.'), 'TODO '.entry,
+            \"State changed back to TODO")
+call vimtap#Unlike(getline(line+1), '^    CLOSED: '.timestampre,
+            \"CLOSED tag removed")
+" Log entries
+call vimtap#Is(getline(line+1), '    :LOGBOOK:',
+            \"LOGBOOK drawer still present")
+call vimtap#Like(getline(line+2), '^        TODO: '.timestampre,
+            \"TODO Log entry added")
+call vimtap#Like(getline(line+3), '^        CANCELLED: '.timestampre,
+            \"CANCELLED Log entry added")
+call vimtap#Like(getline(line+4), '^        DONE: '.timestampre,
+            \"DONE Log entry still present")
+
+call vimtest#Quit()