summaryrefslogtreecommitdiff
path: root/mut/neovim/pack/plugins/start/quicker.nvim/tests/opts_spec.lua
blob: 0732da24a15a37662bfc356915998081bcc73600 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
local quicker = require("quicker")
local test_util = require("tests.test_util")

describe("opts", function()
  after_each(function()
    test_util.reset_editor()
  end)

  it("sets buffer opts", function()
    quicker.setup({
      opts = {
        buflisted = true,
        bufhidden = "wipe",
        cindent = true,
      },
    })
    vim.fn.setqflist({
      {
        bufnr = vim.fn.bufadd("README.md"),
        text = "text",
        lnum = 5,
        valid = 1,
      },
    })
    vim.cmd.copen()
    assert.truthy(vim.bo.buflisted)
    assert.equals("wipe", vim.bo.bufhidden)
    assert.truthy(vim.bo.cindent)
  end)

  it("sets window opts", function()
    quicker.setup({
      opts = {
        wrap = false,
        number = true,
        list = true,
      },
    })
    vim.fn.setqflist({
      {
        bufnr = vim.fn.bufadd("README.md"),
        text = "text",
        lnum = 5,
        valid = 1,
      },
    })
    vim.cmd.copen()
    assert.falsy(vim.wo.wrap)
    assert.truthy(vim.wo.number)
    assert.truthy(vim.wo.list)
  end)
end)