Skip to content

Commit

Permalink
Test allowing g: omitted function names and rejecting global g: omitt…
Browse files Browse the repository at this point in the history
…ed variables

- Added g: omitted function names as invalid case
  • Loading branch information
rhysd committed Nov 28, 2015
1 parent f5acb44 commit 97d024d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ function! autoload#ImplicitGlobalAutoloadFunc(param)
echo autoload#AnotherImplicitGlobalAutoloadFunc(param)
endfunction
call autoload#ImplicitGlobalAutoloadFunc(1)

" implicit global variable 'i'
for i in [1, 2, 3]
endfor
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,12 @@ echo b:
echo w:
echo t:
echo v:

" Allow to omit g: from function names (#136)
function! ImplicitGlobalFunc()
endfunction
call ImplicitGlobalFunc()

function! autoload#ImplicitGlobalAutoloadFunc()
endfunction
call autoload#ImplicitGlobalAutoloadFunc()
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def test_get_violation_if_found_when_file_is_invalid(self):
self.create_violation(8, 5),
self.create_violation(12, 10),
self.create_violation(17, 53),
self.create_violation(22, 5),
]

self.assertFoundViolationsEqual(PATH_INVALID_VIM_SCRIPT,
Expand All @@ -47,6 +48,7 @@ def test_get_violation_if_found_when_autoloads_are_suppressed(self):
self.create_violation(8, 5),
self.create_violation(12, 10),
self.create_violation(17, 53),
self.create_violation(22, 5),
]

self.assertFoundViolationsEqual(PATH_INVALID_VIM_SCRIPT,
Expand Down

0 comments on commit 97d024d

Please sign in to comment.