Repository: neovim/neovim
File: test/functional/ui/float_spec.lua (Lua)

Code before:
      command('set winborder=bold')
      winid = api.nvim_open_win(buf, false, config)
      eq('┏', api.nvim_win_get_config(winid).border[1])

      command([[set winborder=+,-,+,\|,+,-,+,\|]])
      winid = api.nvim_open_win(buf, false, config)
      eq('+', api.nvim_win_get_config(winid).border[1])

      command([[set winborder=●,○,●,○,●,○,●,○]])
      winid = api.nvim_open_win(buf, false, config)
      eq('●', api.nvim_win_get_config(winid).border[1])

      eq('Vim(set):E474: Invalid argument: winborder=,,', pcall_err(command, 'set winborder=,,'))
      eq('Vim(set):E474: Invalid argument: winborder=+,-,+,|,+,-,+,', pcall_err(command, [[set winborder=+,-,+,\|,+,-,+,]]))
      eq('Vim(set):E474: Invalid argument: winborder=custom', pcall_err(command, 'set winborder=custom'))
    end)

    it('cursor shape when the cursor is covered by a floating window', function()
      local normal_win = api.nvim_get_current_win()
      api.nvim_buf_set_lines(0, 0, -1, true, { 'one', 'two' })
      api.nvim_win_set_cursor(0, { 2, 2 })
      local buf = api.nvim_create_buf(false, false)
      api.nvim_buf_set_lines(buf, 0, 0, true, { 'the only line' })
      local win = api.nvim_open_win(buf, false, { relative = 'editor', row = 0, col = 0, height = 2, width = 20 })
      if not multigrid then
        screen:expect { mode = 'replace' }
      end
      api.nvim_buf_set_lines(0, 0, -1, true, { 'one', 'two', 'three' })
      feed('<Down>')
      if not multigrid then
        screen:expect { mode = 'normal' }
      end
      -- Cursor shape on a lower z-index floating window
      buf = api.nvim_create_buf(false, false)
      api.nvim_buf_set_lines(buf, 0, 0, true, { 'highest' })
      local high_win = api.nvim_open_win(buf, false, { relative = 'editor', row = 0, col = 0, height = 2, width = 7, zindex = 150 })
      api.nvim_set_current_win(win)
      api.nvim_win_set_cursor(win, { 2, 1 })
      if not multigrid then
        screen:expect { mode = 'replace' }
      end

      api.nvim_set_current_win(high_win)
      if not multigrid then
        screen:expect { mode = 'normal' }
      end

      buf = api.nvim_create_buf(false, false)
      api.nvim_buf_set_lines(buf, 0, 0, true, { 'another' })
      api.nvim_open_win(buf, true, { relative = 'editor', row = 0, col = 0, height = 2, width = 7, zindex = 160 })
      if not multigrid then

Review comment (suggestion):
seems like there are no asserts for `multigrid=true`, so perhaps just skip (early return) the test if `multigrid` is true? or alternatively, assert what we expect for multigrid case.

Code after:
      command('set winborder=bold')
      winid = api.nvim_open_win(buf, false, config)
      eq('┏', api.nvim_win_get_config(winid).border[1])

      command([[set winborder=+,-,+,\|,+,-,+,\|]])
      winid = api.nvim_open_win(buf, false, config)
      eq('+', api.nvim_win_get_config(winid).border[1])

      command([[set winborder=●,○,●,○,●,○,●,○]])
      winid = api.nvim_open_win(buf, false, config)
      eq('●', api.nvim_win_get_config(winid).border[1])

      eq('Vim(set):E474: Invalid argument: winborder=,,', pcall_err(command, 'set winborder=,,'))
      eq('Vim(set):E474: Invalid argument: winborder=+,-,+,|,+,-,+,', pcall_err(command, [[set winborder=+,-,+,\|,+,-,+,]]))
      eq('Vim(set):E474: Invalid argument: winborder=custom', pcall_err(command, 'set winborder=custom'))
    end)

    it('cursor shape when the cursor is covered by a floating window', function()
      local normal_win = api.nvim_get_current_win()
      api.nvim_buf_set_lines(0, 0, -1, true, { 'one', 'two' })
      api.nvim_win_set_cursor(0, { 2, 2 })
      local buf = api.nvim_create_buf(false, false)
      api.nvim_buf_set_lines(buf, 0, 0, true, { 'the only line' })
      local win = api.nvim_open_win(buf, false, { relative = 'editor', row = 0, col = 0, height = 2, width = 20 })
      if multigrid then
        screen:expect({
          grid = [[
          ## grid 1
            [2:----------------------------------------]|*6
            [3:----------------------------------------]|
          ## grid 2
            one                                     |
            tw^o                                     |
            {0:~                                       }|*4
          ## grid 3
                                                    |
          ## grid 4
            {1:the only line       }|
            {1:                    }|
          ]],
          win_pos = {
            [2] = { height = 6, startcol = 0, startrow = 0, width = 40, win = 1000 },
          },
          float_pos = {
            [4] = { 1001, 'NW', 1, 0, 0, true, 50, 1, 0, 0 },
          },
          mode = 'normal',
        })
      else
        screen:expect {
          grid = [[