mirror of
https://github.com/zoriya/telescope.nvim.git
synced 2026-08-16 02:45:09 +00:00
wip: having some highlighting / flickering issues
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
local LinkedList = require('telescope.algos.linked_list')
|
||||
|
||||
local eq = assert.are.same
|
||||
|
||||
describe('LinkedList', function()
|
||||
it('can create a list', function()
|
||||
local l = LinkedList:new()
|
||||
@@ -129,5 +131,65 @@ describe('LinkedList', function()
|
||||
|
||||
assert.are.same("first", l.tracked)
|
||||
end)
|
||||
|
||||
describe(':shift()', function()
|
||||
it('should return nil for empty list', function()
|
||||
local l = LinkedList:new()
|
||||
|
||||
eq(nil, l:shift())
|
||||
end)
|
||||
|
||||
it('should return the first element, and then nothing if length 1', function()
|
||||
local l = LinkedList:new { track_at = 2 }
|
||||
l:append('hello')
|
||||
|
||||
eq('hello', l:shift())
|
||||
eq(0, l.size)
|
||||
|
||||
eq(nil, l:shift())
|
||||
end)
|
||||
|
||||
it('should return each element', function()
|
||||
local l = LinkedList:new { track_at = 2 }
|
||||
l:append('hello')
|
||||
l:append('world')
|
||||
l:append('last')
|
||||
|
||||
eq('hello', l:shift())
|
||||
eq('world', l:shift())
|
||||
|
||||
eq(1, l.size)
|
||||
end)
|
||||
end)
|
||||
|
||||
describe(':pop()', function()
|
||||
it('should return nil for empty list', function()
|
||||
local l = LinkedList:new()
|
||||
|
||||
eq(nil, l:pop())
|
||||
end)
|
||||
|
||||
it('should return the first element, and then nothing if length 1', function()
|
||||
local l = LinkedList:new { track_at = 2 }
|
||||
l:append('hello')
|
||||
|
||||
eq('hello', l:pop())
|
||||
eq(0, l.size)
|
||||
|
||||
eq(nil, l:pop())
|
||||
end)
|
||||
|
||||
it('should return each element', function()
|
||||
local l = LinkedList:new { track_at = 2 }
|
||||
l:append('hello')
|
||||
l:append('world')
|
||||
l:append('last')
|
||||
|
||||
eq('last', l:pop())
|
||||
eq('world', l:pop())
|
||||
|
||||
eq(1, l.size)
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user