-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
31 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
local list = {} | ||
|
||
list.is_list = vim.is_list | ||
list.is_list = vim.islist | ||
|
||
list.is_empty = vim.tbl_isempty | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
describe('icons', function() | ||
local icons | ||
|
||
before_each(function() | ||
icons = require('vgit.core.icons') | ||
end) | ||
|
||
describe('get', function() | ||
it('should return icon and color when nvim-web-devicons is loaded', function() | ||
package.loaded['nvim-web-devicons'] = { | ||
has_loaded = function() return true end, | ||
get_icon = function(fname, ext) return '', 'blue' end, | ||
} | ||
local icon, color = icons.get('icons_spec.lua', 'lua') | ||
assert.equals('', icon) | ||
assert.equals('blue', color) | ||
end) | ||
|
||
it('should return nil and empty string when nvim-web-devicons is not loaded', function() | ||
package.loaded['nvim-web-devicons'] = { | ||
has_loaded = function() return false end, | ||
} | ||
|
||
local icon, color = icons.get('test.txt', 'txt') | ||
assert.is_nil(icon) | ||
assert.equals('', color) | ||
end) | ||
end) | ||
end) |