2017-05-04 18:19:58 -04:00
|
|
|
Before:
|
|
|
|
runtime ale_linters/java/javac.vim
|
|
|
|
|
2017-11-05 10:33:31 -05:00
|
|
|
call ale#test#SetDirectory('/testplugin/test')
|
|
|
|
call ale#test#SetFilename('dummy.java')
|
|
|
|
|
2017-05-04 18:19:58 -04:00
|
|
|
After:
|
2017-11-05 10:33:31 -05:00
|
|
|
call ale#test#RestoreDirectory()
|
2017-05-04 18:19:58 -04:00
|
|
|
call ale#linter#Reset()
|
|
|
|
|
|
|
|
Execute(The javac handler should handle cannot find symbol errors):
|
|
|
|
AssertEqual
|
|
|
|
\ [
|
|
|
|
\ {
|
2017-12-18 08:27:59 -05:00
|
|
|
\ 'filename': ale#path#Simplify('/tmp/vLPr4Q5/33/foo.java'),
|
2017-05-04 18:19:58 -04:00
|
|
|
\ 'lnum': 1,
|
|
|
|
\ 'text': 'error: some error',
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ },
|
|
|
|
\ {
|
2017-12-18 08:27:59 -05:00
|
|
|
\ 'filename': ale#path#Simplify('/tmp/vLPr4Q5/33/foo.java'),
|
2017-05-04 18:19:58 -04:00
|
|
|
\ 'lnum': 2,
|
2017-06-19 06:45:09 -04:00
|
|
|
\ 'col': 5,
|
2017-05-04 18:19:58 -04:00
|
|
|
\ 'text': 'error: cannot find symbol: BadName',
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ },
|
|
|
|
\ {
|
2017-12-18 08:27:59 -05:00
|
|
|
\ 'filename': ale#path#Simplify('/tmp/vLPr4Q5/33/foo.java'),
|
2017-05-04 18:19:58 -04:00
|
|
|
\ 'lnum': 34,
|
2017-06-19 06:45:09 -04:00
|
|
|
\ 'col': 5,
|
2017-05-04 18:19:58 -04:00
|
|
|
\ 'text': 'error: cannot find symbol: BadName2',
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ },
|
|
|
|
\ {
|
2017-12-18 08:27:59 -05:00
|
|
|
\ 'filename': ale#path#Simplify('/tmp/vLPr4Q5/33/foo.java'),
|
2017-05-04 18:19:58 -04:00
|
|
|
\ 'lnum': 37,
|
|
|
|
\ 'text': 'warning: some warning',
|
|
|
|
\ 'type': 'W',
|
|
|
|
\ },
|
2017-05-04 18:34:52 -04:00
|
|
|
\ {
|
2017-12-18 08:27:59 -05:00
|
|
|
\ 'filename': ale#path#Simplify('/tmp/vLPr4Q5/33/foo.java'),
|
2017-05-04 18:34:52 -04:00
|
|
|
\ 'lnum': 42,
|
2017-06-19 06:45:09 -04:00
|
|
|
\ 'col': 11,
|
2017-05-04 18:34:52 -04:00
|
|
|
\ 'text': 'error: cannot find symbol: bar()',
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ },
|
2017-05-04 18:19:58 -04:00
|
|
|
\ ],
|
2017-11-05 10:33:31 -05:00
|
|
|
\ ale_linters#java#javac#Handle(bufnr(''), [
|
2017-05-04 18:19:58 -04:00
|
|
|
\ '/tmp/vLPr4Q5/33/foo.java:1: error: some error',
|
|
|
|
\ '/tmp/vLPr4Q5/33/foo.java:2: error: cannot find symbol',
|
|
|
|
\ ' BadName foo() {',
|
|
|
|
\ ' ^',
|
|
|
|
\ ' symbol: class BadName',
|
|
|
|
\ ' location: class Bar',
|
|
|
|
\ '/tmp/vLPr4Q5/33/foo.java:34: error: cannot find symbol',
|
|
|
|
\ ' BadName2 foo() {',
|
|
|
|
\ ' ^',
|
|
|
|
\ ' symbol: class BadName2',
|
|
|
|
\ ' location: class Bar',
|
|
|
|
\ '/tmp/vLPr4Q5/33/foo.java:37: warning: some warning',
|
2017-11-05 10:33:31 -05:00
|
|
|
\ '/tmp/vLPr4Q5/33/foo.java:42: error: cannot find symbol',
|
2017-05-04 18:34:52 -04:00
|
|
|
\ ' this.bar();',
|
|
|
|
\ ' ^',
|
|
|
|
\ ' symbol: method bar()',
|
|
|
|
\ '5 errors',
|
2017-05-04 18:19:58 -04:00
|
|
|
\ ])
|
2017-11-05 10:33:31 -05:00
|
|
|
|
|
|
|
Execute(The javac handler should resolve files from different directories):
|
|
|
|
AssertEqual
|
|
|
|
\ [
|
|
|
|
\ {
|
|
|
|
\ 'filename': ale#path#Winify(g:dir . '/Foo.java'),
|
|
|
|
\ 'lnum': 1,
|
|
|
|
\ 'text': 'error: some error',
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'filename': ale#path#Winify(g:dir . '/Bar.java'),
|
|
|
|
\ 'lnum': 1,
|
|
|
|
\ 'text': 'error: some error',
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ },
|
|
|
|
\ ],
|
|
|
|
\ ale_linters#java#javac#Handle(bufnr(''), [
|
|
|
|
\ './Foo.java:1: error: some error',
|
|
|
|
\ './Bar.java:1: error: some error',
|
|
|
|
\ ])
|