summaryrefslogtreecommitdiff
path: root/test/test_path_equality.vader
blob: 7043eb5f8f45fa11a15c8f9931e29966057b28ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Execute(ale#path#IsBufferPath should match simple relative paths):
  silent file! foo.txt

  Assert ale#path#IsBufferPath(bufnr(''), 'foo.txt'), 'No match for foo.txt'
  Assert !ale#path#IsBufferPath(bufnr(''), 'bar.txt'), 'Bad match for bar.txt'

Execute(ale#path#IsBufferPath should match absolute paths):
  silent file! foo.txt

  Assert ale#path#IsBufferPath(bufnr(''), getcwd() . '/foo.txt'), 'No match for foo.txt'
  Assert !ale#path#IsBufferPath(bufnr(''), getcwd() . '/bar.txt'), 'Bad match for bar.txt'

Execute(ale#path#IsBufferPath should match paths beginning with ./):
  silent file! foo.txt

  Assert ale#path#IsBufferPath(bufnr(''), './foo.txt'), 'No match for ./foo.txt'

Execute(ale#path#IsBufferPath should match if our path ends with the test path):
  silent file! foo/bar/baz.txt

  Assert ale#path#IsBufferPath(bufnr(''), 'bar/baz.txt'), 'No match for bar/baz.txt'

Execute(ale#path#IsBufferPath should match paths with redundant slashes):
  silent file! foo.txt

  Assert ale#path#IsBufferPath(bufnr(''), getcwd() . '////foo.txt'), 'No match for foo.txt'

Execute(ale#path#IsBufferPath should accept various names for stdin):
  Assert ale#path#IsBufferPath(bufnr(''), '-')
  Assert ale#path#IsBufferPath(bufnr(''), 'stdin')
  Assert ale#path#IsBufferPath(bufnr(''), '<stdin>')
  Assert ale#path#IsBufferPath(bufnr(''), '<somethingelse>')