aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Schmidt <john.schmidt.h@gmail.com>2014-04-08 17:50:10 +0200
committerThiago de Arruda <tpadilha84@gmail.com>2014-04-08 21:56:05 -0300
commitac620411383259400cff2f12ffe576f066ed4ca7 (patch)
treea32272ff4afae8f7ef39f5ed94260c85a1eb92e7 /test
parent6fb58d1c5c859402871e1d546f7fea1a91dd2995 (diff)
downloadrneovim-ac620411383259400cff2f12ffe576f066ed4ca7.tar.gz
rneovim-ac620411383259400cff2f12ffe576f066ed4ca7.tar.bz2
rneovim-ac620411383259400cff2f12ffe576f066ed4ca7.zip
Move exe functions back to os/fs.c
Diffstat (limited to 'test')
-rw-r--r--test/unit/os/fs.moon2
-rw-r--r--test/unit/path.moon27
2 files changed, 1 insertions, 28 deletions
diff --git a/test/unit/os/fs.moon b/test/unit/os/fs.moon
index c45e64d2d4..c0499fe3dc 100644
--- a/test/unit/os/fs.moon
+++ b/test/unit/os/fs.moon
@@ -172,7 +172,7 @@ describe 'fs function', ->
it 'returns -1 when the given file does not exist', ->
eq -1, (os_getperm 'non-existing-file')
- it 'returns a perm > 0 when given an existing file', ->
+ it 'returns a perm > 0 when given an existing file', ->
assert.is_true (os_getperm 'unit-test-directory') > 0
it 'returns S_IRUSR when the file is readable', ->
diff --git a/test/unit/path.moon b/test/unit/path.moon
index f2fd0a99a5..67d78f8ca1 100644
--- a/test/unit/path.moon
+++ b/test/unit/path.moon
@@ -11,16 +11,12 @@ FileComparison path_full_compare(char_u *s1, char_u *s2, int checkname);
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 path_can_exe(char_u *name);
]]
-
-- import constants parsed by ffi
{:kEqualFiles, :kDifferentFiles, :kBothFilesMissing, :kOneFileMissing, :kEqualFileNames} = path
NULL = ffi.cast 'void*', 0
{:OK, :FAIL} = path
-{:TRUE, :FALSE} = path
describe 'path function', ->
describe 'path_full_compare', ->
@@ -264,26 +260,3 @@ describe 'more path function', ->
it 'returns false if filename starts not with slash nor tilde', ->
eq FAIL, path_is_absolute_path 'not/in/my/home~/directory'
-
- describe 'path_can_exe', ->
- path_can_exe = (name) ->
- path.path_can_exe (to_cstr name)
-
- it 'returns false when given a directory', ->
- eq FALSE, (path_can_exe './unit-test-directory')
-
- it 'returns false when given a regular file without executable bit set', ->
- eq FALSE, (path_can_exe 'unit-test-directory/test.file')
-
- it 'returns false when the given file does not exists', ->
- eq FALSE, (path_can_exe 'does-not-exist.file')
-
- it 'returns true when given an executable inside $PATH', ->
- 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, (path_can_exe relative_executable)
- lfs.chdir old_dir