Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F131701
controller_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
controller_spec.lua
View Options
local
window
=
require
"ivy.window"
local
controller
=
require
"ivy.controller"
describe
(
"controller"
,
function
()
before_each
(
function
()
vim
.
cmd
"highlight IvyMatch cterm=bold gui=bold"
window
.
initialize
()
end
)
after_each
(
function
()
controller
.
destroy
()
end
)
it
(
"will run the completion"
,
function
()
controller
.
run
(
"Testing"
,
function
()
return
{
{
content
=
"Some content"
}
}
end
,
function
()
return
{}
end
)
-- Run all the scheduled tasks
vim
.
wait
(
0
)
local
lines
=
vim
.
api
.
nvim_buf_get_lines
(
0
,
0
,
-
1
,
true
)
assert
.
is_equal
(
#
lines
,
1
)
assert
.
is_equal
(
lines
[
1
],
"Some content"
)
end
)
it
(
"will not try and highlight the buffer if there is nothing to highlight"
,
function
()
spy
.
on
(
vim
,
"cmd"
)
controller
.
items
=
function
()
return
{
{
content
=
"Hello"
}
}
end
controller
.
update
""
vim
.
wait
(
0
)
assert
.
spy
(
vim
.
cmd
).
was_called_with
"syntax clear IvyMatch"
assert
.
spy
(
vim
.
cmd
).
was_not_called_with
"syntax match IvyMatch '[H]'"
end
)
it
(
"will escape a - when passing it to be highlighted"
,
function
()
spy
.
on
(
vim
,
"cmd"
)
controller
.
items
=
function
()
return
{
{
content
=
"Hello"
}
}
end
controller
.
update
"some-file"
vim
.
wait
(
0
)
assert
.
spy
(
vim
.
cmd
).
was_called_with
"syntax match IvyMatch '[some
\\
-file]'"
end
)
end
)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Apr 6 2026, 6:15 PM (5 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
10591
Default Alt Text
controller_spec.lua (1 KB)
Attached To
Mode
R1 ivy.nvim
Attached
Detach File
Event Timeline
Log In to Comment