summaryrefslogtreecommitdiff
path: root/test/test_pattern_options.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-05-26 15:59:43 +0100
committerw0rp <devw0rp@gmail.com>2017-05-26 15:59:43 +0100
commitc77cf0e518e18b2e6f1f259c0f92e717d28c8998 (patch)
treee9a4c43ba79d0b0333c9c0d0f3f0177645388353 /test/test_pattern_options.vader
parent7fe1119cf1154480d8035a078ff06d6739892551 (diff)
downloadale-c77cf0e518e18b2e6f1f259c0f92e717d28c8998.zip
#371 Allow buffer variables to be set based on patterns
Diffstat (limited to 'test/test_pattern_options.vader')
-rw-r--r--test/test_pattern_options.vader28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/test_pattern_options.vader b/test/test_pattern_options.vader
new file mode 100644
index 00000000..ba074418
--- /dev/null
+++ b/test/test_pattern_options.vader
@@ -0,0 +1,28 @@
+Before:
+ Save g:ale_pattern_options, g:ale_pattern_options_enabled
+
+After:
+ Restore
+
+ unlet! b:ale_enabled
+ unlet! b:some_option
+
+Execute(Buffer variables should be set when filename patterns match):
+ let g:ale_pattern_options = {'baz.*\.js': {
+ \ 'ale_enabled': 1,
+ \ 'some_option': 347,
+ \}}
+
+ silent! file foobar.js
+
+ call ale#pattern_options#SetOptions()
+
+ Assert !exists('b:ale_enabled')
+ Assert !exists('b:some_option')
+
+ silent! file bazboz.js
+
+ call ale#pattern_options#SetOptions()
+
+ AssertEqual 1, b:ale_enabled
+ AssertEqual 347, b:some_option