Skip to content

Commit d448a00

Browse files
committed
test: add spec for b:symlink_should_resolve_path
1 parent bded327 commit d448a00

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,8 @@ test: test/vader.vim
2020
@cd test && $(VIM) $(VIM_FLAGS) -o fixture/foo.link fixture/bar.link -c 'Vader! symlink-split-horizontal.vader'
2121
@cd test && $(VIM) $(VIM_FLAGS) -O fixture/foo.link fixture/bar.link -c 'Vader! symlink-split-vertical.vader'
2222
@cd test && $(VIM) $(VIM_FLAGS) -d fixture/foo.link fixture/bar.link -c 'Vader! symlink-split-vertical.vader'
23+
@cd test && $(VIM) $(VIM_FLAGS) \
24+
--cmd 'autocmd! BufReadPre foo.link let b:symlink_should_resolve_path = 0' \
25+
--cmd 'autocmd! BufReadPre bar.link let b:symlink_should_resolve_path = 1' \
26+
-o fixture/foo.link fixture/bar.link \
27+
-c 'Vader! options.vader'

test/options.vader

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Before:
2+
execute 'cd' fnameescape(fnamemodify(g:vader_file, ':p:h'))
3+
4+
" It should follow the symlinks for every file
5+
Execute (skip the 2 Vader.vim buffers):
6+
quit!
7+
quit!
8+
9+
Then (assert that the windows are in the right order with the right content):
10+
AssertEqual 1, tabpagenr('$')
11+
AssertEqual 2, winnr('$')
12+
1 wincmd w
13+
AssertEqual 'fixture/foo.link', bufname()
14+
Assert !get(b:, 'symlink_should_resolve_path', 1)
15+
wincmd j
16+
AssertEqual 'fixture/bar', bufname()
17+
Assert get(b:, 'symlink_should_resolve_path', 1)
18+
AssertEqual ['bar'], getline(1, '$')

0 commit comments

Comments
 (0)