Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F131696
libivy_spec.lua
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
libivy_spec.lua
View Options
require
"busted.runner"
()
local
libivy
=
require
"ivy.libivy"
describe
(
"libivy"
,
function
()
it
(
"should run a simple match"
,
function
()
local
score
=
libivy
.
ivy_match
(
"term"
,
"I am a serch term"
)
assert
.
is_true
(
score
>
0
)
end
)
it
(
"should find a dot file"
,
function
()
local
current_dir
=
libivy
.
ivy_cwd
()
local
results
=
libivy
.
ivy_files
(
".github/workflows/ci.yml"
,
current_dir
)
assert
.
is_equal
(
2
,
results
.
length
,
"Incorrect number of results found"
)
assert
.
is_equal
(
".github/workflows/ci.yml"
,
results
[
2
].
content
,
"Invalid matches"
)
end
)
it
(
"will allow you to access the length via the metatable"
,
function
()
local
current_dir
=
libivy
.
ivy_cwd
()
local
results
=
libivy
.
ivy_files
(
".github/workflows/ci.yml"
,
current_dir
)
local
mt
=
getmetatable
(
results
)
assert
.
is_equal
(
results
.
length
,
mt
.
__len
(
results
),
"The `length` property does not match the __len metamethod"
)
end
)
it
(
"will create an iterator"
,
function
()
local
iter
=
libivy
.
ivy_files
(
".github/workflows/ci.yml"
,
libivy
.
ivy_cwd
())
local
mt
=
getmetatable
(
iter
)
assert
.
is_equal
(
type
(
mt
[
"__index"
]),
"function"
)
assert
.
is_equal
(
type
(
mt
[
"__len"
]),
"function"
)
end
)
end
)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Apr 6 2026, 6:14 PM (5 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
10590
Default Alt Text
libivy_spec.lua (1 KB)
Attached To
Mode
R1 ivy.nvim
Attached
Detach File
Event Timeline
Log In to Comment