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

Code before:
          border='single', footer_pos='left',
         }))
    end)

    it('validate footer_pos in nvim_win_get_config', function()
      local footer_pos = exec_lua([[
        local bufnr = vim.api.nvim_create_buf(false, false)
        local opts = {
          relative = 'editor',
          col = 2,
          row = 5,
          height = 2,
          width = 9,
          border = 'double',
          footer = 'Test',
          footer_pos = 'center'
        }

        local win_id = vim.api.nvim_open_win(bufnr, true, opts)
        return vim.api.nvim_win_get_config(win_id).footer_pos
      ]])

      eq('center', footer_pos)
    end)

    it('truncate the long #title', function()
      local buf = api.nvim_create_buf(false, false)
      api.nvim_buf_set_lines(buf, 0, -1, true, {' halloj! ',
                                             ' BORDAA  '})
      local win = api.nvim_open_win(buf, false, {
        relative='editor', width=9, height=2, row=2, col=5, border="double",
        title = "abcdefghijklmnopqrstuvwxyz",title_pos = "center",
      })

      if multigrid then
        screen:expect{grid=[[
        ## grid 1
          [2:----------------------------------------]|*6
          [3:----------------------------------------]|
        ## grid 2
          ^                                        |
          {0:~                                       }|*5
        ## grid 3
                                                  |
        ## grid 4
          {5:╔}{11:<stuvwxyz}{5:╗}|
          {5:║}{1: halloj! }{5:║}|
          {5:║}{1: BORDAA  }{5:║}|
          {5:╚═════════╝}|
        ]], float_pos={
          [4] = { 1001, "NW", 1, 2, 5, true }

Review comment (suggestion):
```suggestion
    it('truncates title longer than window width #23602', function()
```

Code after:
          {0:~    }{5:_________}{0:                          }|
          {0:~    }{1: halloj! }{0:                          }|
          {0:~    }{1: BORDAA  }{0:                          }|
          {0:~    }{5:---------}{0:                          }|
                                                  |
        ]],
        }
      end

      insert [[
        neeed some dummy
        background text
        to show the effect
        of color blending
        of border shadow
      ]]

      api.nvim_win_set_config(win, { border = 'shadow' })
      if multigrid then
        screen:expect {
          grid = [[
        ## grid 1
          [2:----------------------------------------]|*6
          [3:----------------------------------------]|
        ## grid 2
          neeed some dummy                        |
          background text                         |
          to show the effect                      |
          of color blending                       |
          of border shadow                        |
          ^                                        |
        ## grid 3
                                                  |
        ## grid 4
          {1: halloj! }{25: }|
          {1: BORDAA  }{26: }|
          {25: }{26:         }|
        ]],
          float_pos = { [4] = { 1001, 'NW', 1, 2, 5, true, 50, 1, 2, 5 } },
          win_viewport = {
            [2] = { win = 1000, topline = 0, botline = 6, curline = 5, curcol = 0, linecount = 6, sum_scroll_delta = 0 },
            [4] = { win = 1001, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 2, sum_scroll_delta = 0 },
          },
          win_viewport_margins = {
            [2] = { win = 1000, top = 0, bottom = 0, left = 0, right = 0 },
            [4] = { win = 1001, top = 0, bottom = 1, left = 0, right = 1 },
          },
        }
      else
        screen:expect {
          grid = [[