aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThomas Wienecke <wienecke.t@gmail.com>2014-03-30 01:04:52 +0100
committerThiago de Arruda <tpadilha84@gmail.com>2014-04-03 10:32:41 -0300
commit98b1f73c3f364d11ba54e9950fc2168712da3996 (patch)
treec343dce1f7e599103861cf8a2ccf3909e038823d /test
parentdb92e0b0945fc71ebd6c4620836c3a8d900443f4 (diff)
downloadrneovim-98b1f73c3f364d11ba54e9950fc2168712da3996.tar.gz
rneovim-98b1f73c3f364d11ba54e9950fc2168712da3996.tar.bz2
rneovim-98b1f73c3f364d11ba54e9950fc2168712da3996.zip
Make FPC_* defines an enum type in path.h.
Diffstat (limited to 'test')
-rw-r--r--test/unit/path.moon (renamed from test/unit/misc1.moon)18
1 files changed, 8 insertions, 10 deletions
diff --git a/test/unit/misc1.moon b/test/unit/path.moon
index f408f3d5ec..90142a8cbb 100644
--- a/test/unit/misc1.moon
+++ b/test/unit/path.moon
@@ -1,26 +1,24 @@
{:cimport, :internalize, :eq, :ffi, :lib, :cstr, :to_cstr} = require 'test.unit.helpers'
---misc1 = cimport './src/misc1.h'
+path = lib
--- remove these statements once 'cimport' is working properly for misc1.h
-misc1 = lib
ffi.cdef [[
-enum FPC {
+typedef enum file_comparison {
FPC_SAME = 1, FPC_DIFF = 2, FPC_NOTX = 4, FPC_DIFFX = 6, FPC_SAMEX = 7
-};
-int fullpathcmp(char_u *s1, char_u *s2, int checkname);
+} FileComparison;
+FileComparison fullpathcmp(char_u *s1, char_u *s2, int checkname);
]]
-- import constants parsed by ffi
-{:FPC_SAME, :FPC_DIFF, :FPC_NOTX, :FPC_DIFFX, :FPC_SAMEX} = lib
+{:FPC_SAME, :FPC_DIFF, :FPC_NOTX, :FPC_DIFFX, :FPC_SAMEX} = path
-describe 'misc1 function', ->
+describe 'path function', ->
describe 'fullpathcmp', ->
fullpathcmp = (s1, s2, cn) ->
s1 = to_cstr s1
s2 = to_cstr s2
- misc1.fullpathcmp s1, s2, cn or 0
+ path.fullpathcmp s1, s2, cn or 0
f1 = 'f1.o'
f2 = 'f2.o'
@@ -33,7 +31,7 @@ describe 'misc1 function', ->
after_each ->
os.remove f1
os.remove f2
-
+
it 'returns FPC_SAME when passed the same file', ->
eq FPC_SAME, (fullpathcmp f1, f1)