-- Test suite for testing interactions with API bindings
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local funcs = helpers.funcs
local meths = helpers.meths
local command = helpers.command
local clear = helpers.clear
local eq = helpers.eq
local ok = helpers.ok
local eval = helpers.eval
local feed = helpers.feed
local pcall_err = helpers.pcall_err
local exec_lua = helpers.exec_lua
local matches = helpers.matches
local source = helpers.source
local NIL = helpers.NIL
local retry = helpers.retry
before_each(clear)
describe('lua stdlib', function()
-- İ: `tolower("İ")` is `i` which has length 1 while `İ` itself has
-- length 2 (in bytes).
-- Ⱥ: `tolower("Ⱥ")` is `ⱥ` which has length 2 while `Ⱥ` itself has
-- length 3 (in bytes).
--
-- Note: 'i' !=? 'İ' and 'ⱥ' !=? 'Ⱥ' on some systems.
-- Note: Built-in Nvim comparison (on systems lacking `strcasecmp`) works
-- only on ASCII characters.
it('vim.stricmp', function()
eq(0, funcs.luaeval('vim.stricmp("a", "A")'))
eq(0, funcs.luaeval('vim.stricmp("A", "a")'))
eq(0, funcs.luaeval('vim.stricmp("a", "a")'))
eq(0, funcs.luaeval('vim.stricmp("A", "A")'))
eq(0, funcs.luaeval('vim.stricmp("", "")'))
eq(0, funcs.luaeval('vim.stricmp("\\0", "\\0")'))
eq(0, funcs.luaeval('vim.stricmp("\\0\\0", "\\0\\0")'))
eq(0, funcs.luaeval('vim.stricmp("\\0\\0\\0", "\\0\\0\\0")'))
eq(0, funcs.luaeval('vim.stricmp("\\0\\0\\0A", "\\0\\0\\0a")'))
eq(0, funcs.luaeval('vim.stricmp("\\0\\0\\0a", "\\0\\0\\0A")'))
eq(0, funcs.luaeval('vim.stricmp("\\0\\0\\0a", "\\0\\0\\0a")'))
eq(0, funcs.luaeval('vim.stricmp("a\\0", "A\\0")'))
eq(0, funcs.luaeval('vim.stricmp("A\\0", "a\\0")'))
eq(0, funcs.luaeval('vim.stricmp("a\\0", "a\\0")'))
eq(0, funcs.luaeval('vim.stricmp("A\\0", "A\\0")'))
eq(0, funcs.luaeval('vim.stricmp("\\0a", "\\0A")'))
eq(0, funcs.luaeval('vim.stricmp("\\0A", "\\0a")'))
eq(0, funcs.luaeval('vim.stricmp("\\0a", "\\0a")'))
eq(0, funcs.luaeval('vim.stricmp("\\0A", "\\0A")'))
eq(0, funcs.luaeval('vim.stricmp("\\0a\\0", "\\0A\\
|