]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/vim-lsp/test/lsp/utils/buffer.vimspec

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit 'a39f715c13be3352193ffd9c5b7536b8786eff64' as '.vim/bundle/vim-lsp'
[etc/vim.git] / .vim / bundle / vim-lsp / test / lsp / utils / buffer.vimspec
1 Describe lsp#utils#buffer
2
3     Before each
4         % delete _
5         0put ='foo'
6         1put ='bar'
7         3delete _
8     End
9
10     After all
11         % delete _
12     End
13
14     Describe lsp#utils#buffer#_get_lines
15         It adds a blank line when nobinary and fixendofline are set
16             if !exists('+fixendofline')
17                 Skip This test requires 'fixendofline'
18             endif
19             setl nobinary
20             setl fixendofline
21             Assert Equals(lsp#utils#buffer#_get_lines(bufnr('$')), ['foo', 'bar', ''])
22         End
23
24         It adds a blank line when nobinary, nofixendofline, and endofline are set
25             if !exists('+fixendofline')
26                 Skip This test requires 'fixendofline'
27             endif
28             setl nobinary
29             setl nofixendofline
30             setl endofline
31             Assert Equals(lsp#utils#buffer#_get_lines(bufnr('$')), ['foo', 'bar', ''])
32         End
33
34         It adds a blank line when binary and endofline are set
35             if !exists('+fixendofline')
36                 Skip This test requires 'fixendofline'
37             endif
38             setl binary
39             setl endofline
40             Assert Equals(lsp#utils#buffer#_get_lines(bufnr('$')), ['foo', 'bar', ''])
41         End
42
43         It does not add a blank line when nobinary, nofixendofline, and noendofline are set
44             if !exists('+fixendofline')
45                 Skip This test requires 'fixendofline'
46             endif
47             setl nobinary
48             setl nofixendofline
49             setl noendofline
50             Assert Equals(lsp#utils#buffer#_get_lines(bufnr('$')), ['foo', 'bar'])
51         End
52
53         It does not add a blank line when binary and noendofline are set
54             if !exists('+fixendofline')
55                 Skip This test requires 'fixendofline'
56             endif
57             setl binary
58             setl noendofline
59             Assert Equals(lsp#utils#buffer#_get_lines(bufnr('$')), ['foo', 'bar'])
60         End
61
62         It adds a blank line when nobinary is set
63             if exists('+fixendofline')
64                 Skip This test is not for 'fixendofline'
65             endif
66             setl nobinary
67             Assert Equals(lsp#utils#buffer#_get_lines(bufnr('$')), ['foo', 'bar', ''])
68         End
69
70         It adds a blank line when binary and endofline are set
71             if exists('+fixendofline')
72                 Skip This test is not for 'fixendofline'
73             endif
74             setl binary
75             setl endofline
76             Assert Equals(lsp#utils#buffer#_get_lines(bufnr('$')), ['foo', 'bar', ''])
77         End
78
79         It does not add a blank line when binary and noendofline are set
80             if exists('+fixendofline')
81                 Skip This test is not for 'fixendofline'
82             endif
83             setl binary
84             setl noendofline
85             Assert Equals(lsp#utils#buffer#_get_lines(bufnr('$')), ['foo', 'bar'])
86         End
87     End
88
89     Describe lsp#utils#buffer#get_indent_size
90         It gets shiftwidth if set
91             setl shiftwidth=4
92             setl tabstop=8
93             Assert Equals(lsp#utils#buffer#get_indent_size(bufnr('$')), 4)
94         End
95         It gets tabstop if shiftwidth not set
96             setl shiftwidth=0
97             setl tabstop=12
98             Assert Equals(lsp#utils#buffer#get_indent_size(bufnr('$')), 12)
99         End
100     End
101 End