diff options
author | John Schmidt <john.schmidt.h@gmail.com> | 2014-04-07 18:04:18 +0200 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-04-08 21:56:05 -0300 |
commit | 6fb58d1c5c859402871e1d546f7fea1a91dd2995 (patch) | |
tree | 4244498e670f344ef20eeb5c3782604d22e770b2 /test | |
parent | aa7218b646e52554621471df3668c2e1d95aa9c9 (diff) | |
download | rneovim-6fb58d1c5c859402871e1d546f7fea1a91dd2995.tar.gz rneovim-6fb58d1c5c859402871e1d546f7fea1a91dd2995.tar.bz2 rneovim-6fb58d1c5c859402871e1d546f7fea1a91dd2995.zip |
Change prefix from `os_*` to `path_*`
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/os/fs.moon | 16 | ||||
-rw-r--r-- | test/unit/path.moon | 32 |
2 files changed, 24 insertions, 24 deletions
diff --git a/test/unit/os/fs.moon b/test/unit/os/fs.moon index fdbb2e8ee3..c45e64d2d4 100644 --- a/test/unit/os/fs.moon +++ b/test/unit/os/fs.moon @@ -61,12 +61,12 @@ describe 'fs function', -> buf = cstr (len-1), '' eq FAIL, (os_dirname buf, (len-1)) - describe 'os_full_dir_name', -> - ffi.cdef 'int os_full_dir_name(char *directory, char *buffer, int len);' + describe 'path_full_dir_name', -> + ffi.cdef 'int path_full_dir_name(char *directory, char *buffer, int len);' - os_full_dir_name = (directory, buffer, len) -> + path_full_dir_name = (directory, buffer, len) -> directory = to_cstr directory - fs.os_full_dir_name directory, buffer, len + fs.path_full_dir_name directory, buffer, len before_each -> -- Create empty string buffer which will contain the resulting path. @@ -74,7 +74,7 @@ describe 'fs function', -> export buffer = cstr len, '' it 'returns the absolute directory name of a given relative one', -> - result = os_full_dir_name '..', buffer, len + result = path_full_dir_name '..', buffer, len eq OK, result old_dir = lfs.currentdir! lfs.chdir '..' @@ -83,14 +83,14 @@ describe 'fs function', -> eq expected, (ffi.string buffer) it 'returns the current directory name if the given string is empty', -> - eq OK, (os_full_dir_name '', buffer, len) + eq OK, (path_full_dir_name '', buffer, len) eq lfs.currentdir!, (ffi.string buffer) it 'fails if the given directory does not exist', -> - eq FAIL, os_full_dir_name('does_not_exist', buffer, len) + eq FAIL, path_full_dir_name('does_not_exist', buffer, len) it 'works with a normal relative dir', -> - result = os_full_dir_name('unit-test-directory', buffer, len) + result = path_full_dir_name('unit-test-directory', buffer, len) eq lfs.currentdir! .. '/unit-test-directory', (ffi.string buffer) eq OK, result diff --git a/test/unit/path.moon b/test/unit/path.moon index 71350b7925..f2fd0a99a5 100644 --- a/test/unit/path.moon +++ b/test/unit/path.moon @@ -12,7 +12,7 @@ char_u *path_tail(char_u *fname); char_u *path_tail_with_sep(char_u *fname); char_u *path_next_component(char_u *fname); int is_executable(char_u *name); -int os_can_exe(char_u *name); +int path_can_exe(char_u *name); ]] @@ -249,41 +249,41 @@ describe 'more path function', -> eq OK, (path.append_path path1, to_append, 7) eq '/path2', (ffi.string path1) - describe 'os_is_absolute_path', -> - ffi.cdef 'int os_is_absolute_path(char *fname);' + describe 'path_is_absolute_path', -> + ffi.cdef 'int path_is_absolute_path(char *fname);' - os_is_absolute_path = (filename) -> + path_is_absolute_path = (filename) -> filename = to_cstr filename - path.os_is_absolute_path filename + path.path_is_absolute_path filename it 'returns true if filename starts with a slash', -> - eq OK, os_is_absolute_path '/some/directory/' + eq OK, path_is_absolute_path '/some/directory/' it 'returns true if filename starts with a tilde', -> - eq OK, os_is_absolute_path '~/in/my/home~/directory' + eq OK, path_is_absolute_path '~/in/my/home~/directory' it 'returns false if filename starts not with slash nor tilde', -> - eq FAIL, os_is_absolute_path 'not/in/my/home~/directory' + eq FAIL, path_is_absolute_path 'not/in/my/home~/directory' - describe 'os_can_exe', -> - os_can_exe = (name) -> - path.os_can_exe (to_cstr name) + describe 'path_can_exe', -> + path_can_exe = (name) -> + path.path_can_exe (to_cstr name) it 'returns false when given a directory', -> - eq FALSE, (os_can_exe './unit-test-directory') + eq FALSE, (path_can_exe './unit-test-directory') it 'returns false when given a regular file without executable bit set', -> - eq FALSE, (os_can_exe 'unit-test-directory/test.file') + eq FALSE, (path_can_exe 'unit-test-directory/test.file') it 'returns false when the given file does not exists', -> - eq FALSE, (os_can_exe 'does-not-exist.file') + eq FALSE, (path_can_exe 'does-not-exist.file') it 'returns true when given an executable inside $PATH', -> - eq TRUE, (os_can_exe executable_name) + eq TRUE, (path_can_exe executable_name) it 'returns true when given an executable relative to the current dir', -> old_dir = lfs.currentdir! lfs.chdir directory relative_executable = './' .. executable_name - eq TRUE, (os_can_exe relative_executable) + eq TRUE, (path_can_exe relative_executable) lfs.chdir old_dir |