]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/test_path_upwards.vader

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 'd49e95aa7ba744f0a7f544aca43afdb6aab41f24' as '.vim/bundle/asyncomplete...
[etc/vim.git] / .vim / bundle / ale / test / test_path_upwards.vader
1 Execute(ale#path#Upwards should return the correct path components):
2   if has('unix')
3     " Absolute paths should include / on the end.
4     AssertEqual
5     \ ['/foo/bar/baz', '/foo/bar', '/foo', '/'],
6     \ ale#path#Upwards('/foo/bar/baz')
7     AssertEqual
8     \ ['/foo/bar/baz', '/foo/bar', '/foo', '/'],
9     \ ale#path#Upwards('/foo/bar/baz///')
10     " Relative paths do not.
11     AssertEqual
12     \ ['foo/bar/baz', 'foo/bar', 'foo'],
13     \ ale#path#Upwards('foo/bar/baz')
14     AssertEqual
15     \ ['foo2/bar', 'foo2'],
16     \ ale#path#Upwards('foo//..////foo2////bar')
17     " Expect an empty List for empty strings.
18     AssertEqual [], ale#path#Upwards('')
19   endif
20
21   if has('win32')
22     AssertEqual
23     \ ['C:\foo\bar\baz', 'C:\foo\bar', 'C:\foo', 'C:\'],
24     \ ale#path#Upwards('C:\foo\bar\baz')
25     AssertEqual
26     \ ['C:\foo\bar\baz', 'C:\foo\bar', 'C:\foo', 'C:\'],
27     \ ale#path#Upwards('C:\foo\bar\baz\\\')
28     AssertEqual
29     \ ['/foo\bar\baz', '/foo\bar', '/foo', '/'],
30     \ ale#path#Upwards('/foo/bar/baz')
31     AssertEqual
32     \ ['foo\bar\baz', 'foo\bar', 'foo'],
33     \ ale#path#Upwards('foo/bar/baz')
34     AssertEqual
35     \ ['foo\bar\baz', 'foo\bar', 'foo'],
36     \ ale#path#Upwards('foo\bar\baz')
37     " simplify() is used internally, and should sort out \ paths when actually
38     " running Windows, which we can't test here.
39     AssertEqual
40     \ ['foo2\bar', 'foo2'],
41     \ ale#path#Upwards('foo//..///foo2////bar')
42     " Expect an empty List for empty strings.
43     AssertEqual [], ale#path#Upwards('')
44     " Paths starting with // return /
45     AssertEqual
46     \ ['/foo2\bar', '/foo2', '/'],
47     \ ale#path#Upwards('//foo//..///foo2////bar')
48   endif