Skip to content

Commit

Permalink
test: add compiler tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tmillr committed Jul 15, 2024
1 parent 40b5489 commit 0f26fef
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/github-theme/config/compiler_spec.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
local assert = require('luassert')
local t_util = require('github-theme._test.util')
local uniqgrp = t_util.unique_hlgroup

if vim.fn.has('nvim-0.9.0') == 0 or vim.fn.has('nvim-0.9.0') == false then
return
end

describe('compiler', function()
it('should consider previously-set overrides (1)', function()
local same_opts = {}
require('github-theme').setup(same_opts)
require('github-theme.override').groups = { all = { Normal = { link = uniqgrp } } }
require('github-theme').setup(same_opts)
vim.cmd.colorscheme({ args = { 'github_dark_dimmed' } })
assert.same({ link = uniqgrp }, t_util.get_hl('Normal', true))
end)

it('should consider previously-set overrides (2)', function()
require('github-theme').setup({})
require('github-theme.override').groups = { all = { Normal = { link = uniqgrp } } }
vim.cmd.colorscheme({ args = { 'github_dark_dimmed' } })
assert.same({ link = uniqgrp }, t_util.get_hl('Normal', true))
end)
end)

0 comments on commit 0f26fef

Please sign in to comment.