Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F131851
utils_line_action_test.lua
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
894 B
Referenced Files
None
Subscribers
None
utils_line_action_test.lua
View Options
local
utils
=
require
"ivy.utils"
local
line_action
=
utils
.
line_action
()
local
vim_mock
=
require
"ivy.vim_mock"
before_each
(
function
()
vim_mock
.
reset
()
end
)
it
(
"will run the line command"
,
function
(
t
)
line_action
" 4: Some text"
if
#
vim_mock
.
commands
~=
1
then
t
.
error
"`line_action` command length should be 1"
end
if
vim_mock
.
commands
[
1
]
~=
"4"
then
t
.
error
"`line_action` command should be 4"
end
end
)
it
(
"will run with more numbers"
,
function
(
t
)
line_action
" 44: Some text"
if
#
vim_mock
.
commands
~=
1
then
t
.
error
"`line_action` command length should be 1"
end
if
vim_mock
.
commands
[
1
]
~=
"44"
then
t
.
error
"`line_action` command should be 44"
end
end
)
it
(
"dose not run any action if no line is found"
,
function
(
t
)
line_action
"Some text"
if
#
vim_mock
.
commands
~=
0
then
t
.
error
"`line_action` command length should be 1"
end
end
)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Apr 6 2026, 6:33 PM (5 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16052
Default Alt Text
utils_line_action_test.lua (894 B)
Attached To
Mode
R1 ivy.nvim
Attached
Detach File
Event Timeline
Log In to Comment