]> git.madduck.net Git - etc/vim.git/blob - 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:

Squashed '.vim/bundle/ale/' content from commit 22185c4c
[etc/vim.git] / test / handler / test_mcsc_handler.vader
1 Before:
2   Save g:ale_cs_mcsc_source
3
4   unlet! g:ale_cs_mcsc_source
5
6   call ale#test#SetDirectory('/testplugin/test/handler')
7   call ale#test#SetFilename('Test.cs')
8
9   runtime ale_linters/cs/mcsc.vim
10
11 After:
12   unlet! g:ale_cs_mcsc_source
13
14   call ale#test#RestoreDirectory()
15   call ale#linter#Reset()
16
17 Execute(The mcs handler should work with the default of the buffer's directory):
18   AssertEqual
19   \ [
20   \   {
21   \     'lnum': 12,
22   \     'col' : 29,
23   \     'text': '; expected',
24   \     'code': 'CS1001',
25   \     'type': 'E',
26   \     'filename': ale#path#Simplify(g:dir . '/Test.cs'),
27   \   },
28   \ ],
29   \ ale_linters#cs#mcsc#Handle(bufnr(''), [
30   \   'Test.cs(12,29): error CS1001: ; expected',
31   \   'Compilation failed: 2 error(s), 1 warnings',
32   \ ])
33
34 Execute(The mcs handler should handle cannot find symbol errors):
35   let g:ale_cs_mcsc_source = '/home/foo/project/bar'
36
37   AssertEqual
38   \ [
39   \   {
40   \     'lnum': 12,
41   \     'col' : 29,
42   \     'text': '; expected',
43   \     'code': 'CS1001',
44   \     'type': 'E',
45   \     'filename': ale#path#Simplify('/home/foo/project/bar/Test.cs'),
46   \   },
47   \   {
48   \     'lnum': 101,
49   \     'col': 0,
50   \     'text': 'Unexpected processor directive (no #if for this #endif)',
51   \     'code': 'CS1028',
52   \     'type': 'E',
53   \     'filename': ale#path#Simplify('/home/foo/project/bar/Test.cs'),
54   \   },
55   \   {
56   \     'lnum': 10,
57   \     'col': 12,
58   \     'text': 'some warning',
59   \     'code': 'CS0123',
60   \     'type': 'W',
61   \     'filename': ale#path#Simplify('/home/foo/project/bar/Test.cs'),
62   \   },
63   \ ],
64   \ ale_linters#cs#mcsc#Handle(bufnr(''), [
65   \   'Test.cs(12,29): error CS1001: ; expected',
66   \   'Test.cs(101,0): error CS1028: Unexpected processor directive (no #if for this #endif)',
67   \   'Test.cs(10,12): warning CS0123: some warning',
68   \   'Compilation failed: 2 error(s), 1 warnings',
69   \ ])
70
71 Execute(The mcsc handler should handle non file specific compiler errors without reporting overal status report as error):
72   let g:ale_cs_mcsc_source = '/home/foo/project/bar'
73
74   AssertEqual
75   \ [
76   \   {
77   \     'lnum': -1,
78   \     'col' : -1,
79   \     'text': 'No files to compile were specified',
80   \     'code': 'CS2008',
81   \     'type': 'E',
82   \     'filename': '<mcs>',
83   \   },
84   \ ],
85   \ ale_linters#cs#mcsc#Handle(bufnr(''), [
86   \     'error CS2008: No files to compile were specified',
87   \     'Compilation failed: 1 error(s), 0 warnings',
88   \ ])