]> git.madduck.net Git - etc/vim.git/blobdiff - .vim/bundle/ale/test/test_getmatches.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 / test_getmatches.vader
diff --git a/.vim/bundle/ale/test/test_getmatches.vader b/.vim/bundle/ale/test/test_getmatches.vader
new file mode 100644 (file)
index 0000000..edf84f6
--- /dev/null
@@ -0,0 +1,163 @@
+Execute (ale#util#GetMatches should return matches for many lines):
+  AssertEqual
+  \ [
+  \   [
+  \     '/path/to/some-filename.js:47:14: Missing trailing comma. [Warning/comma-dangle]',
+  \     '47',
+  \     '14',
+  \     'Missing trailing comma.',
+  \     'Warning/comma-dangle',
+  \     '',
+  \     '',
+  \     '',
+  \     '',
+  \     '',
+  \   ],
+  \   [
+  \     '/path/to/some-filename.js:56:41: Missing semicolon. [Error/semi]',
+  \     '56',
+  \     '41',
+  \     'Missing semicolon.',
+  \     'Error/semi',
+  \     '',
+  \     '',
+  \     '',
+  \     '',
+  \     '',
+  \   ],
+  \ ],
+  \ ale#util#GetMatches(
+  \   [
+  \     '/path/to/some-filename.js:47:14: Missing trailing comma. [Warning/comma-dangle]',
+  \     '/path/to/some-filename.js:56:41: Missing semicolon. [Error/semi]',
+  \   ],
+  \   [
+  \     '^.*:\(\d\+\):\(\d\+\): \(.\+\) \[\(.\+\)\]$',
+  \   ]
+  \ )
+
+Execute (ale#util#GetMatches should accept a string for a single pattern):
+  AssertEqual
+  \ [
+  \   [
+  \     '/path/to/some-filename.js:47:14: Missing trailing comma. [Warning/comma-dangle]',
+  \     '47',
+  \     '14',
+  \     'Missing trailing comma.',
+  \     'Warning/comma-dangle',
+  \     '',
+  \     '',
+  \     '',
+  \     '',
+  \     '',
+  \   ],
+  \   [
+  \     '/path/to/some-filename.js:56:41: Missing semicolon. [Error/semi]',
+  \     '56',
+  \     '41',
+  \     'Missing semicolon.',
+  \     'Error/semi',
+  \     '',
+  \     '',
+  \     '',
+  \     '',
+  \     '',
+  \   ],
+  \ ],
+  \ ale#util#GetMatches(
+  \   [
+  \     '/path/to/some-filename.js:47:14: Missing trailing comma. [Warning/comma-dangle]',
+  \     '/path/to/some-filename.js:56:41: Missing semicolon. [Error/semi]',
+  \   ],
+  \   '^.*:\(\d\+\):\(\d\+\): \(.\+\) \[\(.\+\)\]$'
+  \ )
+
+Execute (ale#util#MapMatches should map matches):
+  AssertEqual
+  \ [
+  \   '/path/to/some-filename.js:47:14: Missing trailing comma. [Warning/comma-dangle]',
+  \   '/path/to/some-filename.js:56:41: Missing semicolon. [Error/semi]',
+  \ ],
+  \ ale#util#MapMatches(
+  \   [
+  \     '/path/to/some-filename.js:47:14: Missing trailing comma. [Warning/comma-dangle]',
+  \     '/path/to/some-filename.js:56:41: Missing semicolon. [Error/semi]',
+  \   ],
+  \   '^.*:\(\d\+\):\(\d\+\): \(.\+\) \[\(.\+\)\]$',
+  \   {match -> match[0]}
+  \ )
+
+Execute (ale#util#GetMatches should accept a single line as a string):
+  AssertEqual
+  \ [
+  \   [
+  \     '/path/to/some-filename.js:47:14: Missing trailing comma. [Warning/comma-dangle]',
+  \     '47',
+  \     '14',
+  \     'Missing trailing comma.',
+  \     'Warning/comma-dangle',
+  \     '',
+  \     '',
+  \     '',
+  \     '',
+  \     '',
+  \   ],
+  \ ],
+  \ ale#util#GetMatches(
+  \   '/path/to/some-filename.js:47:14: Missing trailing comma. [Warning/comma-dangle]',
+  \   [
+  \     '^.*:\(\d\+\):\(\d\+\): \(.\+\) \[\(.\+\)\]$',
+  \   ]
+  \ )
+
+Execute (ale#util#GetMatches should match multiple patterns correctly):
+  AssertEqual
+  \ [
+  \   [
+  \     '/path/to/some-filename.js:47:14: Missing trailing comma. [Warning/comma-dangle]',
+  \     '47',
+  \     '14',
+  \     'Missing trailing comma.',
+  \     'Warning/comma-dangle',
+  \     '',
+  \     '',
+  \     '',
+  \     '',
+  \     '',
+  \   ],
+  \   [
+  \     '/path/to/some-filename.js:56:41: Missing semicolon. [Error/semi]',
+  \     '56',
+  \     '41',
+  \     'Missing semicolon.',
+  \     'Error/semi',
+  \     '',
+  \     '',
+  \     '',
+  \     '',
+  \     '',
+  \   ],
+  \   [
+  \     '/path/to/some-filename.js:13:3: Parsing error: Unexpected token',
+  \     '13',
+  \     '3',
+  \     'Parsing error: Unexpected token',
+  \     '',
+  \     '',
+  \     '',
+  \     '',
+  \     '',
+  \     '',
+  \   ],
+  \ ],
+  \ ale#util#GetMatches(
+  \   [
+  \     '/path/to/some-filename.js:47:14: Missing trailing comma. [Warning/comma-dangle]',
+  \     '/path/to/some-filename.js:56:41: Missing semicolon. [Error/semi]',
+  \     '/path/to/some-filename.js:13:3: Parsing error: Unexpected token',
+  \   ],
+  \   [
+  \     '^.*:\(\d\+\):\(\d\+\): \(.\+\) \[\(.\+\)\]$',
+  \     '^.*:\(\d\+\):\(\d\+\): \(.\+\)$',
+  \   ]
+  \ )