• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tarantool / crud / 6615352971

23 Oct 2023 03:42PM UTC coverage: 89.145% (-0.08%) from 89.22%
6615352971

push

github

DifferentialOrange
crud: allow tuple fields of select options to be cdata in type checks

In scope of tarantool/tarantool#8147, box tuples returned from remote
procedure calls our now encoded as a new extension, `MP_TUPLE`, and, as,
the results of such calls are now decoded as box tuples, i.e., cdata. For
compatibility with this feature, we need to allow tuple fields of select
options, which are returned from a remote procedure calls, to be cdata in
option type checks.

Needed for tarantool/tarantool#8147

4673 of 5242 relevant lines covered (89.15%)

14936.72 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.33
/crud/common/compat.lua
1
local log = require('log')
360✔
2

3
local compat = {}
360✔
4

5
function compat.require(module_name, builtin_module_name)
360✔
6
    local module_cached_name = string.format('__crud_%s_cached', module_name)
1,800✔
7

8
    local module
9

10
    local module_cached = rawget(_G, module_cached_name)
1,800✔
11
    if module_cached ~= nil then
1,800✔
12
        module = module_cached
1,086✔
13
    elseif package.search(module_name) then
1,428✔
14
        -- we don't use pcall(require, module_name) here because it
15
        -- leads to ignoring errors other than 'No LuaRocks module found'
16
        log.info('%q module is used', module_name)
×
17
        module = require(module_name)
×
18
    else
19
        log.info('%q module is not found. Built-in %q is used', module_name, builtin_module_name)
714✔
20
        module = require(builtin_module_name)
1,428✔
21
    end
22

23
    rawset(_G, module_cached_name, module)
1,800✔
24

25
    return module
1,800✔
26
end
27

28
function compat.exists(module_name, builtin_module_name)
360✔
29
    local module_cached = rawget(_G, string.format('__crud_%s_cached', module_name))
1,080✔
30
    if module_cached ~= nil then
1,080✔
31
        return true
723✔
32
    end
33

34
    if package.search(module_name) then
714✔
35
        return true
×
36
    end
37

38
    if package.loaded[builtin_module_name] ~= nil then
357✔
39
        return true
357✔
40
    end
41

42
    return false
×
43
end
44

45
return compat
360✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc