aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThomas Wienecke <wienecke.t@gmail.com>2014-03-30 20:06:04 +0200
committerThiago de Arruda <tpadilha84@gmail.com>2014-04-03 10:32:41 -0300
commit955d6a29496d9f7902e95f4a2cc01fedd56e4a21 (patch)
treea4f66e7d0572840487e898ebe93df2315bb3ec2c /test
parent7021b970b9e8b3f9b9fe71546bfb3aa30851abd2 (diff)
downloadrneovim-955d6a29496d9f7902e95f4a2cc01fedd56e4a21.tar.gz
rneovim-955d6a29496d9f7902e95f4a2cc01fedd56e4a21.tar.bz2
rneovim-955d6a29496d9f7902e95f4a2cc01fedd56e4a21.zip
Test and refactor getnextcomp -> path_next_component.
Diffstat (limited to 'test')
-rw-r--r--test/unit/path.moon13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/path.moon b/test/unit/path.moon
index efa3a2ce74..8e153b66bf 100644
--- a/test/unit/path.moon
+++ b/test/unit/path.moon
@@ -9,6 +9,7 @@ typedef enum file_comparison {
FileComparison path_full_compare(char_u *s1, char_u *s2, int checkname);
char_u *path_tail(char_u *fname);
char_u *path_tail_with_seperator(char_u *fname);
+char_u *path_next_component(char_u *fname);
]]
-- import constants parsed by ffi
@@ -85,3 +86,15 @@ describe 'path function', ->
it 'returns the whole file name if there is no seperator', ->
eq 'file.txt', path_tail_with_seperator 'file.txt'
+
+ describe 'path_next_component', ->
+ path_next_component = (file) ->
+ res = path.path_next_component (to_cstr file)
+ neq NULL, res
+ ffi.string res
+
+ it 'returns', ->
+ eq 'directory/file.txt', path_next_component 'some/directory/file.txt'
+
+ it 'returns empty string if given file contains no seperator', ->
+ eq '', path_next_component 'file.txt'