diff options
author | ZyX <kp-pav@yandex.ru> | 2016-06-24 00:06:46 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2016-06-24 00:07:57 +0300 |
commit | 6580dfeddd9693b778f59ca5c333d05200d67687 (patch) | |
tree | 8839783a5f32976b0c6c55f6b4a7874ccc39d229 /test/unit/os/fileio_spec.lua | |
parent | 75bd39d49c09896a885ac700862f9b3bb84f6069 (diff) | |
download | rneovim-6580dfeddd9693b778f59ca5c333d05200d67687.tar.gz rneovim-6580dfeddd9693b778f59ca5c333d05200d67687.tar.bz2 rneovim-6580dfeddd9693b778f59ca5c333d05200d67687.zip |
unittests: Fix kFileNoSymlink test on FreeBSD
Actual value on FreeBSD is -31, UV_EMLINK was obtained from
/usr/include/asm-generic/errno-base.h (there EMLINK is defined as 31 there).
This may actually be something else, but I do not think so as “Too many links”
description also fits in. [Man page][1] agrees with me, search for `[EMLINK]`
([linux man page][2] also specifies ELOOP explicitly in a similar section).
[1]: https://www.freebsd.org/cgi/man.cgi?query=open&sektion=2
[2]: http://man7.org/linux/man-pages/man3/open.3p.html
Diffstat (limited to 'test/unit/os/fileio_spec.lua')
-rw-r--r-- | test/unit/os/fileio_spec.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/unit/os/fileio_spec.lua b/test/unit/os/fileio_spec.lua index 3f0bd16e6c..59d85926d9 100644 --- a/test/unit/os/fileio_spec.lua +++ b/test/unit/os/fileio_spec.lua @@ -128,7 +128,9 @@ describe('file_open', function() it('fails to open an symlink with kFileNoSymlink', function() local err, fp = file_open(linkf, m.kFileNoSymlink, 384) - eq(m.UV_ELOOP, err) + -- err is UV_EMLINK in FreeBSD, but if I use `ok(err == m.UV_ELOOP or err == + -- m.UV_EMLINK)`, then I loose the ability to see actual `err` value. + if err ~= m.UV_ELOOP then eq(m.UV_EMLINK, err) end end) it('can open an existing file write-only with kFileCreate', function() |