mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-19 17:42:57 +08:00
#427 Add a function for looking up ALE variables in buffer scope, and then global scope
This commit is contained in:
16
test/test_ale_var.vader
Normal file
16
test/test_ale_var.vader
Normal file
@@ -0,0 +1,16 @@
|
||||
Before:
|
||||
let g:ale_some_variable = 'abc'
|
||||
|
||||
After:
|
||||
unlet! g:ale_some_variable
|
||||
|
||||
Execute(ale#Var should return global variables):
|
||||
AssertEqual 'abc', ale#Var(bufnr(''), 'some_variable')
|
||||
|
||||
Execute(ale#Var should return buffer overrides):
|
||||
let b:ale_some_variable = 'def'
|
||||
|
||||
AssertEqual 'def', ale#Var(bufnr(''), 'some_variable')
|
||||
|
||||
Execute(ale#Var should throw exceptions for undefined variables):
|
||||
AssertThrows call ale#Var(bufnr(''), 'undefined_variable_name')
|
||||
Reference in New Issue
Block a user