Skip to content
Snippets Groups Projects
Commit b3db87df authored by Mergen Imeev's avatar Mergen Imeev Committed by Mergen
Browse files

lua: introduce is_interval for datetime.interval

This patch introduces is_interval() function for
require('datetime').interval.

Closes #10269

@TarantoolBot document
Title: Function require('datetime').interval.is_interval()

All modules representing field types, with the exception of `interval`
(i.e. `varbinary`, `uuid`, `decimal`, `datetime`), have an `is()` or
an `is_<type_name>()` function. Now such a function `is_interval()` is
provided for the `interval` module.
parent f83fded7
No related branches found
No related tags found
No related merge requests found
## feature/box
* Added the `is_interval` function to check that the provided value is
`interval` (gh-10269).
......@@ -1303,6 +1303,7 @@ ffi.metatype(interval_t, {
local interval_mt = {
new = interval_new,
is_interval = is_interval,
}
return setmetatable(
......
......@@ -34,3 +34,8 @@ end
g.test_check_interval_encode_ffi = function()
t.assert_equals(bin, msgpackffi.encode(val))
end
g.test_is_interval = function()
t.assert(itv.is_interval(val))
t.assert_not(itv.is_interval({}))
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment