]> git.madduck.net Git - etc/vim.git/blobdiff - .vim/bundle/ale/test/handler/test_mcsc_handler.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '76265755a1add77121c8f9dabb3e9bb70fe9a972' as '.vim/bundle/ale'
[etc/vim.git] / .vim / bundle / ale / test / handler / test_mcsc_handler.vader
diff --git a/.vim/bundle/ale/test/handler/test_mcsc_handler.vader b/.vim/bundle/ale/test/handler/test_mcsc_handler.vader
new file mode 100644 (file)
index 0000000..c04f7d2
--- /dev/null
@@ -0,0 +1,88 @@
+Before:
+  Save g:ale_cs_mcsc_source
+
+  unlet! g:ale_cs_mcsc_source
+
+  call ale#test#SetDirectory('/testplugin/test/handler')
+  call ale#test#SetFilename('Test.cs')
+
+  runtime ale_linters/cs/mcsc.vim
+
+After:
+  unlet! g:ale_cs_mcsc_source
+
+  call ale#test#RestoreDirectory()
+  call ale#linter#Reset()
+
+Execute(The mcs handler should work with the default of the buffer's directory):
+  AssertEqual
+  \ [
+  \   {
+  \     'lnum': 12,
+  \     'col' : 29,
+  \     'text': '; expected',
+  \     'code': 'CS1001',
+  \     'type': 'E',
+  \     'filename': ale#path#Simplify(g:dir . '/Test.cs'),
+  \   },
+  \ ],
+  \ ale_linters#cs#mcsc#Handle(bufnr(''), [
+  \   'Test.cs(12,29): error CS1001: ; expected',
+  \   'Compilation failed: 2 error(s), 1 warnings',
+  \ ])
+
+Execute(The mcs handler should handle cannot find symbol errors):
+  let g:ale_cs_mcsc_source = '/home/foo/project/bar'
+
+  AssertEqual
+  \ [
+  \   {
+  \     'lnum': 12,
+  \     'col' : 29,
+  \     'text': '; expected',
+  \     'code': 'CS1001',
+  \     'type': 'E',
+  \     'filename': ale#path#Simplify('/home/foo/project/bar/Test.cs'),
+  \   },
+  \   {
+  \     'lnum': 101,
+  \     'col': 0,
+  \     'text': 'Unexpected processor directive (no #if for this #endif)',
+  \     'code': 'CS1028',
+  \     'type': 'E',
+  \     'filename': ale#path#Simplify('/home/foo/project/bar/Test.cs'),
+  \   },
+  \   {
+  \     'lnum': 10,
+  \     'col': 12,
+  \     'text': 'some warning',
+  \     'code': 'CS0123',
+  \     'type': 'W',
+  \     'filename': ale#path#Simplify('/home/foo/project/bar/Test.cs'),
+  \   },
+  \ ],
+  \ ale_linters#cs#mcsc#Handle(bufnr(''), [
+  \   'Test.cs(12,29): error CS1001: ; expected',
+  \   'Test.cs(101,0): error CS1028: Unexpected processor directive (no #if for this #endif)',
+  \   'Test.cs(10,12): warning CS0123: some warning',
+  \   'Compilation failed: 2 error(s), 1 warnings',
+  \ ])
+
+Execute(The mcsc handler should handle non file specific compiler errors without reporting overal status report as error):
+  let g:ale_cs_mcsc_source = '/home/foo/project/bar'
+
+  AssertEqual
+  \ [
+  \   {
+  \     'lnum': -1,
+  \     'col' : -1,
+  \     'text': 'No files to compile were specified',
+  \     'code': 'CS2008',
+  \     'type': 'E',
+  \     'filename': '<mcs>',
+  \   },
+  \ ],
+  \ ale_linters#cs#mcsc#Handle(bufnr(''), [
+  \     'error CS2008: No files to compile were specified',
+  \     'Compilation failed: 1 error(s), 0 warnings',
+  \ ])