robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Justin M. KeyesMerge #40865 from justinmk/fixcif907614088

master
664 B28 linesraw
1local t = require('test.unit.testutil')
2local describe = t.describe
3local itp = t.gen_itp(t.it)
4
5local to_cstr = t.to_cstr
6local eq = t.eq
7
8local optionstr = t.cimport('./src/nvim/optionstr.h')
9
10local check_ff_value = function(ff)
11  return optionstr.check_ff_value(to_cstr(ff))
12end
13
14describe('check_ff_value', function()
15  itp('views empty string as invalid', function()
16    eq(0, check_ff_value(''))
17  end)
18
19  itp('views "unix", "dos" and "mac" as valid', function()
20    eq(1, check_ff_value('unix'))
21    eq(1, check_ff_value('dos'))
22    eq(1, check_ff_value('mac'))
23  end)
24
25  itp('views "foo" as invalid', function()
26    eq(0, check_ff_value('foo'))
27  end)
28end)