aboutsummaryrefslogtreecommitdiff
path: root/test/benchmark/text_spec.lua
blob: 52e97f441256595ddbb2533e0173db6087616d61 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
local t = require('test.testutil')

local describe, it = t.describe, t.it
describe('vim.text', function()
  local input, output = string.rep('😂', 2 ^ 16), string.rep('F09F9882', 2 ^ 16)

  it('hexencode', function()
    t.bench(function()
      vim.text.hexencode(input)
    end, { n = 100, label = 'hexencode' })
  end)

  it('hexdecode', function()
    t.bench(function()
      vim.text.hexdecode(output)
    end, { n = 100, label = 'hexdecode' })
  end)
end)