# Test variable management (should be small)

# PR #1132 make other test break ...

#Given vimwiki (abc def ghi jkl #1132):
#  abc def ghi jkl
#
#Do (vee<CR>):
#  :call SetSyntax('markdown')\<CR>
#  :call vimwiki#vars#set_wikilocal('links_space_char', '_')\<CR>
#  vee\<CR>
#  :call vimwiki#vars#set_wikilocal('links_space_char', ' ')\<CR>
#
#Expect (underscores in link url not in description):
#  [abc def](abc_def) ghi jkl
#
# Issue #980
#
# brennen commenting these out 2021-03-29 per @tinmarino:
# https://github.com/vimwiki/vimwiki/pull/1108#issuecomment-806775805

# Given txt (txt):
#   txt
#
# Execute (VimWei vars #980):
#   " Set
#   call UnloadVimwiki()
#   let wiki = {}
#   let wiki.name = 'ChenWei  🦊VimwikiMd @^%@!*#&^'
#   let wiki.path = $HOME . '/testmarkdown'
#   let wiki.ext = '.md'
#   let wiki.syntax = 'markdown'
#   let wiki.nested_syntaxes = {'python': 'python'}
#   
#   " Make other tests crash
#   "let wiki.links_space_char = '_'
#   "let wiki.list_margin = 0
#   "let wiki.auto_toc = 1
#   "let wiki.auto_tags = 1
#   "let wiki.auto_generate_tags = 1
#
#   let g:vimwiki_list = [wiki]
#   let g:vimwiki_ext2syntax = {'.md': 'markdown'}
#   let g:vimwiki_global_ext = 1
#   let g:vimwiki_autowriteall = 1
#   let g:vimwiki_auto_chdir = 1
#   let g:vimwiki_folding = 'expr'
#   call LoadVimwiki()
#
#   " Log
#   Log 'Path (Current): ' . getcwd()
#   Log 'File: (Buffer)' . @%
#   Log 'List (Wiki): ' . string(g:vimwiki_list)
#   Log ''
#   Log 'Local (Vars):'
#   Log g:vimwiki_wikilocal_vars
#
#   " Work
#   edit $HOME/testmarkdown/index.md
#
#   " Assert
#   AssertEqual '/home/vimtest/testmarkdown_cwd', getcwd() . '_cwd'
#   AssertEqual '0_wiki_nr', vimwiki#vars#get_bufferlocal('wiki_nr') . '_wiki_nr'
#   AssertEqual 'markdown_syntax', vimwiki#vars#get_wikilocal('syntax') . '_syntax'
#   AssertEqual '0_margin', vimwiki#vars#get_wikilocal('list_margin') . '_margin'
#   Log 'Path (Current): ' . getcwd()
#   Log 'File (Buffer):' . @%
#   bprevious
#   Log 'Path (Current): ' . getcwd()
#   Log 'File (Buffer):' . @%
#   bwipeout index.md
#   
#   " Clean
#   Log 'Clean up'
#   cd /testplugin 
#   unlet g:vimwiki_list
#   unlet g:vimwiki_ext2syntax
#   unlet g:vimwiki_global_ext
#   unlet g:vimwiki_autowriteall
#   unlet g:vimwiki_auto_chdir
#   unlet g:vimwiki_folding
#   unlet wiki
#   Log 'Path (Current): ' . getcwd()
#   Log 'File (Buffer):' . @%
#   call ReloadVimwiki()
#   Log g:vimwiki_wikilocal_vars
#
# Expect (txt):
#   txt

# vim: sw=2:foldlevel=30:foldmethod=indent:
