From 090dca5740bc2f89c695c96daaa0c61d40fa4252 Mon Sep 17 00:00:00 2001 From: Lukas Reineke <lukas.reineke@protonmail.com> Date: Thu, 28 Sep 2023 12:14:54 +0900 Subject: [PATCH] fix tests --- lua/ibl/config.lua | 2 +- specs/features/virt_text_spec.lua | 94 +++++++++++++++---------------- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/lua/ibl/config.lua b/lua/ibl/config.lua index a8feb84c..dfafa3b1 100644 --- a/lua/ibl/config.lua +++ b/lua/ibl/config.lua @@ -217,7 +217,7 @@ local validate_config = function(config) node_type = { config.scope.exclude.node_type, "table", true }, } end - if config.scope.exclude then + if config.scope.include then vim.validate { node_type = { config.scope.include.node_type, "table", true }, } diff --git a/specs/features/virt_text_spec.lua b/specs/features/virt_text_spec.lua index fc8549fe..2e39c927 100644 --- a/specs/features/virt_text_spec.lua +++ b/specs/features/virt_text_spec.lua @@ -310,10 +310,10 @@ describe("virt_text", function() vt.get(config, char_map, whitespace_tbl, scope_active, scope_index, scope_end, scope_col_start_single) assert.are.same(virt_text, { - { "f", "@indent.char.1" }, - { "e", "@indent.whitespace.1" }, - { "f", "@indent.char.1" }, - { "e", "@indent.whitespace.1" }, + { "f", { "@ibl.whitespace.char.1", "@ibl.indent.char.1" } }, + { "e", { "@ibl.whitespace.char.1" } }, + { "f", { "@ibl.whitespace.char.1", "@ibl.indent.char.1" } }, + { "e", { "@ibl.whitespace.char.1" } }, }) end) @@ -338,12 +338,12 @@ describe("virt_text", function() vt.get(config, char_map, whitespace_tbl, scope_active, scope_index, scope_end, scope_col_start_single) assert.are.same(virt_text, { - { "a", "@indent.char.1" }, - { "e", "@indent.whitespace.1" }, - { "b", "@indent.char.1" }, - { "e", "@indent.whitespace.1" }, - { "c", "@indent.char.1" }, - { "e", "@indent.whitespace.1" }, + { "a", { "@ibl.whitespace.char.1", "@ibl.indent.char.1" } }, + { "e", { "@ibl.whitespace.char.1" } }, + { "b", { "@ibl.whitespace.char.1", "@ibl.indent.char.1" } }, + { "e", { "@ibl.whitespace.char.1" } }, + { "c", { "@ibl.whitespace.char.1", "@ibl.indent.char.1" } }, + { "e", { "@ibl.whitespace.char.1" } }, }) end) @@ -368,12 +368,12 @@ describe("virt_text", function() vt.get(config, char_map, whitespace_tbl, scope_active, scope_index, scope_end, scope_col_start_single) assert.are.same(virt_text, { - { "a", "@indent.char.1" }, - { "d", "@indent.whitespace.1" }, - { "b", "@indent.char.1" }, - { "d", "@indent.whitespace.1" }, - { "c", "@indent.char.1" }, - { "d", "@indent.whitespace.1" }, + { "a", { "@ibl.whitespace.char.1", "@ibl.indent.char.1" } }, + { "d", { "@ibl.whitespace.char.1" } }, + { "b", { "@ibl.whitespace.char.1", "@ibl.indent.char.1" } }, + { "d", { "@ibl.whitespace.char.1" } }, + { "c", { "@ibl.whitespace.char.1", "@ibl.indent.char.1" } }, + { "d", { "@ibl.whitespace.char.1" } }, }) end) @@ -398,10 +398,10 @@ describe("virt_text", function() vt.get(config, char_map, whitespace_tbl, scope_active, scope_index, scope_end, scope_col_start_single) assert.are.same(virt_text, { - { "e", "@indent.whitespace.1" }, - { "e", "@indent.whitespace.1" }, - { "e", "@indent.whitespace.1" }, - { "e", "@indent.whitespace.1" }, + { "e", { "@ibl.whitespace.char.1" } }, + { "e", { "@ibl.whitespace.char.1" } }, + { "e", { "@ibl.whitespace.char.1" } }, + { "e", { "@ibl.whitespace.char.1" } }, }) end) @@ -426,10 +426,10 @@ describe("virt_text", function() vt.get(config, char_map, whitespace_tbl, scope_active, scope_index, scope_end, scope_col_start_single) assert.are.same(virt_text, { - { "f", "@indent.char.1" }, - { "e", "@indent.whitespace.1" }, - { "f", "@indent.scope.char.1.1" }, - { "e", "@indent.whitespace.1" }, + { "f", { "@ibl.whitespace.char.1", "@ibl.indent.char.1" } }, + { "e", { "@ibl.whitespace.char.1" } }, + { "f", { "@ibl.whitespace.char.1", "@ibl.scope.char.1" } }, + { "e", { "@ibl.whitespace.char.1" } }, }) end) @@ -454,11 +454,11 @@ describe("virt_text", function() vt.get(config, char_map, whitespace_tbl, scope_active, scope_index, scope_end, scope_col_start_single) assert.are.same(virt_text, { - { "a", "@indent.char.1" }, - { "c", "@indent.whitespace.1" }, - { "c", "@indent.whitespace.1" }, - { "d", "@indent.whitespace.1" }, - { "b", "@indent.char.1" }, + { "a", { "@ibl.whitespace.char.1", "@ibl.indent.char.1" } }, + { "c", { "@ibl.whitespace.char.1" } }, + { "c", { "@ibl.whitespace.char.1" } }, + { "d", { "@ibl.whitespace.char.1" } }, + { "b", { "@ibl.whitespace.char.1", "@ibl.indent.char.1" } }, }) end) @@ -486,12 +486,12 @@ describe("virt_text", function() vt.get(config, char_map, whitespace_tbl, scope_active, scope_index, scope_end, scope_col_start_single) assert.are.same(virt_text, { - { "f", "@indent.char.1" }, - { "e", "@indent.whitespace.1" }, - { "f", "@indent.char.2" }, - { "e", "@indent.whitespace.2" }, - { "f", "@indent.char.3" }, - { "e", "@indent.whitespace.3" }, + { "f", { "@ibl.whitespace.char.1", "@ibl.indent.char.1" } }, + { "e", { "@ibl.whitespace.char.1" } }, + { "f", { "@ibl.whitespace.char.2", "@ibl.indent.char.2" } }, + { "e", { "@ibl.whitespace.char.2" } }, + { "f", { "@ibl.whitespace.char.3", "@ibl.indent.char.3" } }, + { "e", { "@ibl.whitespace.char.3" } }, }) end) @@ -520,12 +520,12 @@ describe("virt_text", function() vt.get(config, char_map, whitespace_tbl, scope_active, scope_index, scope_end, scope_col_start_single) assert.are.same(virt_text, { - { "f", "@indent.char.1" }, - { "e", "@indent.whitespace.1" }, - { "f", "@indent.scope.char.2.2" }, - { "e", "@indent.whitespace.2" }, - { "f", "@indent.char.3" }, - { "e", "@indent.whitespace.3" }, + { "f", { "@ibl.whitespace.char.1", "@ibl.indent.char.1" } }, + { "e", { "@ibl.whitespace.char.1" } }, + { "f", { "@ibl.whitespace.char.2", "@ibl.scope.char.2" } }, + { "e", { "@ibl.whitespace.char.2" } }, + { "f", { "@ibl.whitespace.char.3", "@ibl.indent.char.3" } }, + { "e", { "@ibl.whitespace.char.3" } }, }) end) @@ -554,12 +554,12 @@ describe("virt_text", function() vt.get(config, char_map, whitespace_tbl, scope_active, scope_index, scope_end, scope_col_start_single) assert.are.same(virt_text, { - { "f", "@indent.char.1" }, - { "e", "@indent.whitespace.1" }, - { "f", "@indent.scope.corner.2.2" }, - { "e", "@indent.scope.end.2.2" }, - { "f", "@indent.scope.end.3.2" }, - { "e", "@indent.scope.end.3.2" }, + { "f", { "@ibl.whitespace.char.1", "@ibl.indent.char.1" } }, + { "e", { "@ibl.whitespace.char.1" } }, + { "f", { "@ibl.whitespace.char.2", "@ibl.scope.char.2", "@ibl.scope.underline.2" } }, + { "e", { "@ibl.whitespace.char.2", "@ibl.scope.underline.2" } }, + { "f", { "@ibl.whitespace.char.3", "@ibl.indent.char.3", "@ibl.scope.underline.2" } }, + { "e", { "@ibl.whitespace.char.3", "@ibl.scope.underline.2" } }, }) end) end)