Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F132161
window_test.lua
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
799 B
Referenced Files
None
Subscribers
None
window_test.lua
View Options
local
vim_mock
=
require
"ivy.vim_mock"
local
window
=
require
"ivy.window"
before_each
(
function
()
vim_mock
.
reset
()
end
)
it
(
"can initialize and destroy the window"
,
function
(
t
)
window
.
initialize
()
t
.
assert_equal
(
10
,
window
.
get_buffer
())
t
.
assert_equal
(
10
,
window
.
buffer
)
window
.
destroy
()
t
.
assert_equal
(
nil
,
window
.
buffer
)
end
)
it
(
"can set items"
,
function
(
t
)
window
.
initialize
()
window
.
set_items
{
{
content
=
"Line one"
}
}
t
.
assert_equal
(
"Line one"
,
window
.
get_current_selection
())
end
)
it
(
"will set the items when a string is passed in"
,
function
(
t
)
window
.
initialize
()
local
items
=
table.concat
({
"One"
,
"Two"
,
"Three"
},
"
\n
"
)
window
.
set_items
(
items
)
local
lines
=
table.concat
(
vim_mock
.
get_lines
()[
window
.
buffer
],
"
\n
"
)
t
.
assert_equal
(
items
,
lines
)
end
)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Apr 10 2026, 8:29 AM (5 w, 20 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16102
Default Alt Text
window_test.lua (799 B)
Attached To
Mode
R1 ivy.nvim
Attached
Detach File
Event Timeline
Log In to Comment