aboutsummaryrefslogtreecommitdiff
path: root/test/functional/core
diff options
context:
space:
mode:
authorEdwin Pujols <73705427+shade-of-noon@users.noreply.github.com>2020-12-11 19:54:39 -0400
committerGitHub <noreply@github.com>2020-12-11 18:54:39 -0500
commitf2ec0586021dd363566922bd7d6dbd3ab7703e38 (patch)
tree334d125b55c2d886a6cafd5eba0cf63e60e8fe2d /test/functional/core
parent4620ad604f58f22e07152b80a4969055643f684f (diff)
downloadrneovim-f2ec0586021dd363566922bd7d6dbd3ab7703e38.tar.gz
rneovim-f2ec0586021dd363566922bd7d6dbd3ab7703e38.tar.bz2
rneovim-f2ec0586021dd363566922bd7d6dbd3ab7703e38.zip
tests: Take into account magic hyphen. (#13518)
In Lua patterns the hyphen works like a non-greedy version of Vim's `*`. - Use `%-` when you need a literal hyphen. - If you don't need a regular expression at all, use something like ``` string.find(text, pattern, 1, true) ``` so that the pattern is regarded as a plain, non-magical string. See [1] and [2] in the Lua manual. [1]: https://www.lua.org/manual/5.1/manual.html#pdf-Patterns [2]: https://www.lua.org/manual/5.1/manual.html#pdf-string.find
Diffstat (limited to 'test/functional/core')
-rw-r--r--test/functional/core/startup_spec.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua
index ff0fdbea45..d5f03db03a 100644
--- a/test/functional/core/startup_spec.lua
+++ b/test/functional/core/startup_spec.lua
@@ -428,9 +428,9 @@ end)
describe('clean', function()
clear()
- ok(string.match(meths.get_option('runtimepath'), funcs.stdpath('config')) ~= nil)
+ ok(string.find(meths.get_option('runtimepath'), funcs.stdpath('config'), 1, true) ~= nil)
clear('--clean')
- ok(string.match(meths.get_option('runtimepath'), funcs.stdpath('config')) == nil)
+ ok(string.find(meths.get_option('runtimepath'), funcs.stdpath('config'), 1, true) == nil)
end)
describe('user config init', function()