aboutsummaryrefslogtreecommitdiff
path: root/test/unit/os
diff options
context:
space:
mode:
authorScott Prager <splinterofchaos@gmail.com>2014-07-22 16:00:16 -0400
committerJustin M. Keyes <justinkz@gmail.com>2014-07-30 18:25:43 -0400
commitc3b9f863ea09eaf1bf56c0112db1c3e2baca1457 (patch)
tree6ab7e0655377970fe130480f65c6fda7aa8b12f8 /test/unit/os
parent5f9fb6ed6433620d1091af8f83cd9b5e8324ffa2 (diff)
downloadrneovim-c3b9f863ea09eaf1bf56c0112db1c3e2baca1457.tar.gz
rneovim-c3b9f863ea09eaf1bf56c0112db1c3e2baca1457.tar.bz2
rneovim-c3b9f863ea09eaf1bf56c0112db1c3e2baca1457.zip
Units: Move NULL, OK, and FAIL to helpers.moon. #982
Diffstat (limited to 'test/unit/os')
-rw-r--r--test/unit/os/env_spec.moon4
-rw-r--r--test/unit/os/fs_spec.moon6
-rw-r--r--test/unit/os/users_spec.moon6
3 files changed, 3 insertions, 13 deletions
diff --git a/test/unit/os/env_spec.moon b/test/unit/os/env_spec.moon
index 43fd663d9a..ab5b940a58 100644
--- a/test/unit/os/env_spec.moon
+++ b/test/unit/os/env_spec.moon
@@ -1,10 +1,8 @@
-{:cimport, :internalize, :eq, :ffi, :lib, :cstr, :to_cstr} = require 'test.unit.helpers'
+{:cimport, :internalize, :eq, :ffi, :lib, :cstr, :to_cstr, :NULL} = require 'test.unit.helpers'
require 'lfs'
env = cimport './src/nvim/os/os.h'
-NULL = ffi.cast 'void*', 0
-
describe 'env function', ->
os_setenv = (name, value, override) ->
diff --git a/test/unit/os/fs_spec.moon b/test/unit/os/fs_spec.moon
index 6d87cb95df..52f587d6f9 100644
--- a/test/unit/os/fs_spec.moon
+++ b/test/unit/os/fs_spec.moon
@@ -1,13 +1,9 @@
-{:cimport, :cppimport, :internalize, :eq, :neq, :ffi, :lib, :cstr, :to_cstr} = require 'test.unit.helpers'
+{:cimport, :cppimport, :internalize, :eq, :neq, :ffi, :lib, :cstr, :to_cstr, :OK, :FAIL} = require 'test.unit.helpers'
require 'lfs'
require 'bit'
fs = cimport './src/nvim/os/os.h'
--- TODO(aktau): define these constants "better"
-FAIL = 0
-OK = 1
-
cppimport 'sys/stat.h'
cppimport 'sys/fcntl.h'
cppimport 'sys/errno.h'
diff --git a/test/unit/os/users_spec.moon b/test/unit/os/users_spec.moon
index d6b618eb8c..35c23ccc6f 100644
--- a/test/unit/os/users_spec.moon
+++ b/test/unit/os/users_spec.moon
@@ -1,11 +1,7 @@
-{:cimport, :internalize, :eq, :ffi, :lib, :cstr} = require 'test.unit.helpers'
+{:cimport, :internalize, :eq, :ffi, :lib, :cstr, :NULL, :OK, :FAIL} = require 'test.unit.helpers'
users = cimport './src/nvim/os/os.h', 'unistd.h'
-NULL = ffi.cast 'void*', 0
-OK = 1
-FAIL = 0
-
garray_new = () ->
ffi.new 'garray_T[1]'