add option to run 1 test case

This commit is contained in:
windwp 2021-03-14 18:16:50 +07:00
parent 36f1422bfe
commit 5244e629d3
3 changed files with 25 additions and 3 deletions

View File

@ -1,3 +1,8 @@
if not _G.test_close then
return
end
local ts = require 'nvim-treesitter.configs'
local helpers = {}
ts.setup {
@ -172,8 +177,6 @@ for _, value in pairs(data) do
end
end
if #run_data == 0 then run_data = data end
local autotag = require('nvim-ts-autotag')
autotag.enableRename = false
local _, ts_utils = pcall(require, 'nvim-treesitter.ts_utils')
_G.TU=ts_utils

View File

@ -22,8 +22,9 @@ lua << EOF
local _, ts_utils = pcall(require, 'nvim-treesitter.ts_utils')
_G.T=ts_utils
_G.test_rename = true
_G.test_close = true
require("plenary/busted")
require("nvim-ts-autotag").setup()
EOF

View File

@ -1,4 +1,9 @@
local ts = require 'nvim-treesitter.configs'
if not _G.test_rename then
return
end
local helpers = {}
ts.setup {
ensure_installed = 'maintained',
@ -68,6 +73,19 @@ local data = {
},
after = [[<lala class="lla" ]]
},
-- {
-- only=true,
-- name = "html not rename close tag if it have parent node map with child nod" ,
-- filepath = './sample/index.html',
-- filetype = "html",
-- linenr = 12,
-- key = [[ciwlala]],
-- before = {
-- [[<d|iv> </div>]],
-- [[<div> </div>"]]
-- },
-- after = [[<d|iv> </div>]]
-- },
{
name = "html not rename close tag with not valid" ,
filepath = './sample/index.html',