Skip to content

Commit 7bb41eb

Browse files
committed
chore: assert config
1 parent eea2014 commit 7bb41eb

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

tests/test_API.lua

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,32 @@ end
4040

4141
T["setup()"]["overrides default values"] = function()
4242
child.lua([[require('search-and-replace').setup({
43-
-- write all the options with a value different than the default ones
4443
debug = true,
44+
default_replace_prompt_to_normal_mode = true,
45+
default_replace_prompt_to_selection = true,
46+
---@type table
47+
mappings = {
48+
enabled = true,
49+
search_and_replace_by_pattern = "<Leader>foo",
50+
replace_by_pattern = "<Leader>bar",
51+
replace_by_reference = "<Leader>baz",
52+
replace_undo = "<Leader>buz",
53+
},
4554
})]])
4655

4756
-- assert the value, and the type
48-
Helpers.expect.config(child, "debug", true)
49-
Helpers.expect.config_type(child, "debug", "boolean")
57+
Helpers.expect.config(child, "", {
58+
debug = true,
59+
default_replace_prompt_to_normal_mode = true,
60+
default_replace_prompt_to_selection = true,
61+
mappings = {
62+
enabled = true,
63+
replace_by_pattern = "<Leader>bar",
64+
replace_by_reference = "<Leader>baz",
65+
replace_undo = "<Leader>buz",
66+
search_and_replace_by_pattern = "<Leader>foo",
67+
},
68+
})
5069
end
5170

5271
return T

0 commit comments

Comments
 (0)