chore: use stylua for formatting (#1040)
* chore: stylua job and config * reformat with stylua
This commit is contained in:
@@ -2,12 +2,11 @@ local eq = function(a, b)
|
||||
assert.are.same(a, b)
|
||||
end
|
||||
|
||||
local resolve = require('telescope.config.resolve')
|
||||
local resolve = require "telescope.config.resolve"
|
||||
|
||||
|
||||
describe('telescope.config.resolve', function()
|
||||
describe('win_option', function()
|
||||
it('should resolve for percentages', function()
|
||||
describe("telescope.config.resolve", function()
|
||||
describe("win_option", function()
|
||||
it("should resolve for percentages", function()
|
||||
local height_config = 0.8
|
||||
local opt = resolve.win_option(height_config)
|
||||
|
||||
@@ -16,7 +15,7 @@ describe('telescope.config.resolve', function()
|
||||
eq(height_config, opt.results)
|
||||
end)
|
||||
|
||||
it('should resolve for percetnages with default', function()
|
||||
it("should resolve for percetnages with default", function()
|
||||
local height_config = 0.8
|
||||
local opt = resolve.win_option(nil, height_config)
|
||||
|
||||
@@ -25,8 +24,8 @@ describe('telescope.config.resolve', function()
|
||||
eq(height_config, opt.results)
|
||||
end)
|
||||
|
||||
it('should resolve table values', function()
|
||||
local table_val = {'a'}
|
||||
it("should resolve table values", function()
|
||||
local table_val = { "a" }
|
||||
local opt = resolve.win_option(nil, table_val)
|
||||
|
||||
eq(table_val, opt.preview)
|
||||
@@ -34,32 +33,32 @@ describe('telescope.config.resolve', function()
|
||||
eq(table_val, opt.results)
|
||||
end)
|
||||
|
||||
it('should allow overrides for different wins', function()
|
||||
local prompt_override = {'a', prompt = 'b'}
|
||||
it("should allow overrides for different wins", function()
|
||||
local prompt_override = { "a", prompt = "b" }
|
||||
local opt = resolve.win_option(prompt_override)
|
||||
eq('a', opt.preview)
|
||||
eq('a', opt.results)
|
||||
eq('b', opt.prompt)
|
||||
eq("a", opt.preview)
|
||||
eq("a", opt.results)
|
||||
eq("b", opt.prompt)
|
||||
end)
|
||||
|
||||
it('should allow overrides for all wins', function()
|
||||
local all_specified = {preview = 'a', prompt = 'b', results = 'c'}
|
||||
it("should allow overrides for all wins", function()
|
||||
local all_specified = { preview = "a", prompt = "b", results = "c" }
|
||||
local opt = resolve.win_option(all_specified)
|
||||
eq('a', opt.preview)
|
||||
eq('b', opt.prompt)
|
||||
eq('c', opt.results)
|
||||
eq("a", opt.preview)
|
||||
eq("b", opt.prompt)
|
||||
eq("c", opt.results)
|
||||
end)
|
||||
|
||||
it('should allow some specified with a simple default', function()
|
||||
local some_specified = {prompt = 'b', results = 'c'}
|
||||
local opt = resolve.win_option(some_specified, 'a')
|
||||
eq('a', opt.preview)
|
||||
eq('b', opt.prompt)
|
||||
eq('c', opt.results)
|
||||
it("should allow some specified with a simple default", function()
|
||||
local some_specified = { prompt = "b", results = "c" }
|
||||
local opt = resolve.win_option(some_specified, "a")
|
||||
eq("a", opt.preview)
|
||||
eq("b", opt.prompt)
|
||||
eq("c", opt.results)
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('resolve_height/width', function()
|
||||
describe("resolve_height/width", function()
|
||||
eq(10, resolve.resolve_height(0.1)(nil, 24, 100))
|
||||
eq(2, resolve.resolve_width(0.1)(nil, 24, 100))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user