Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F131488
controller_test.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_test.lua
View Options
local
vim_mock
=
require
"ivy.vim_mock"
local
window
=
require
"ivy.window"
local
controller
=
require
"ivy.controller"
-- The number of the mock buffer where all the test completions gets put
local
buffer_number
=
10
before_each
(
function
()
vim_mock
.
reset
()
window
.
initialize
()
end
)
after_each
(
function
()
controller
.
destroy
()
end
)
it
(
"will run"
,
function
(
t
)
controller
.
run
(
"Testing"
,
function
()
return
{
{
content
=
"Some content"
}
}
end
,
function
()
return
{}
end
)
local
lines
=
vim_mock
.
get_lines
()
local
completion_lines
=
lines
[
buffer_number
]
t
.
assert_equal
(
#
completion_lines
,
1
)
t
.
assert_equal
(
completion_lines
[
1
],
"Some content"
)
end
)
it
(
"will not try and highlight the buffer if there is nothing to highlight"
,
function
(
t
)
controller
.
items
=
function
()
return
{
{
content
=
"Hello"
}
}
end
controller
.
update
""
local
commands
=
vim_mock
.
get_commands
()
t
.
assert_equal
(
#
commands
,
1
)
end
)
it
(
"will escape a - when passing it to be highlighted"
,
function
(
t
)
controller
.
items
=
function
()
return
{
{
content
=
"Hello"
}
}
end
controller
.
update
"some-file"
local
commands
=
vim_mock
.
get_commands
()
local
syntax_command
=
commands
[
2
]
t
.
assert_equal
(
"syntax match IvyMatch '[some
\\
-file]'"
,
syntax_command
)
end
)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Apr 6 2026, 5:58 PM (5 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16063
Default Alt Text
controller_test.lua (1 KB)
Attached To
Mode
R1 ivy.nvim
Attached
Detach File
Event Timeline
Log In to Comment