enc: run kotlin test under cursor

This commit is contained in:
asep.komarudin 2024-06-30 10:17:10 +07:00
parent c3d0591394
commit 4ba72487b4

View file

@ -112,8 +112,14 @@ if pcode.active_kotlin_config or false then
{
"<leader>Tu",
function()
local current_word = vim.fn.expand("<cword>")
vim.cmd("terminal ./gradlew test --tests *." .. current_word)
-- local current_word = vim.fn.expand("<cword>")
local current_word = ""
local input = vim.fn.getline(".")
current_word = all_trim((input:gsub("class", "")):gsub("{", "")) -- hilangkan bagian class
current_word = current_word:gsub("fun", "")
current_word = current_word:gsub("%(%)", "")
current_word = current_word:gsub("{", "")
vim.cmd("terminal ./gradlew test --tests *." .. all_trim(current_word))
end,
desc = "Run Under Cursor",
},