aboutsummaryrefslogtreecommitdiff
path: root/test/functional/options/modified_spec.lua
blob: ff74c255014aadb69c831a64a2bd5987ff29e8e8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
local t = require('test.testutil')
local n = require('test.functional.testnvim')()

local describe, it, before_each = t.describe, t.it, t.before_each
local clear = n.clear
local eq = t.eq
local api = n.api

describe("'modified'", function()
  before_each(function()
    clear()
  end)

  it("can be unset after changing 'fileformat'", function()
    for _, ff in ipairs({ 'unix', 'dos', 'mac' }) do
      api.nvim_set_option_value('fileformat', ff, {})
      api.nvim_set_option_value('modified', false, {})
      eq(false, api.nvim_get_option_value('modified', {}), 'fileformat=' .. ff)
    end
  end)
end)