summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2016-10-14 20:34:21 +0100
committerw0rp <devw0rp@gmail.com>2016-10-14 20:34:21 +0100
commitc726503acfc104acd9ee6d540479c085f98f4194 (patch)
treef8c10c5bbd315b08995c301b44f9cef674c7ae11 /test
parent56b866c8d8c1dc9e236019a74d4baeafb3bbcb57 (diff)
downloadale-c726503acfc104acd9ee6d540479c085f98f4194.zip
Correct the order of arguments for AssertEqual in some places.
Diffstat (limited to 'test')
-rw-r--r--test/test_ale_statusline.vader18
-rw-r--r--test/test_common_handlers.vader20
-rw-r--r--test/test_loclist_binary_search.vader10
-rw-r--r--test/test_loclist_sorting.vader4
4 files changed, 26 insertions, 26 deletions
diff --git a/test/test_ale_statusline.vader b/test/test_ale_statusline.vader
index 68643a24..9866a75a 100644
--- a/test/test_ale_statusline.vader
+++ b/test/test_ale_statusline.vader
@@ -5,7 +5,7 @@ After:
let g:ale_buffer_loclist_map = {}
Execute (Count should be 0 when data is empty):
- AssertEqual ale#statusline#Count(bufnr('%')), [0, 0]
+ AssertEqual [0, 0], ale#statusline#Count(bufnr('%'))
Before:
let g:ale_buffer_count_map = {'44': [1, 2]}
@@ -14,13 +14,13 @@ After:
let g:ale_buffer_loclist_map = {}
Execute (Count should read data from the cache):
- AssertEqual ale#statusline#Count(44), [1, 2]
+ AssertEqual [1, 2], ale#statusline#Count(44)
Execute (Update the cache with new data):
call ale#statusline#Update(44, [])
Then (The cache should reflect the new data):
- AssertEqual ale#statusline#Count(44), [0, 0]
+ AssertEqual [0, 0], ale#statusline#Count(44)
Before:
let g:ale_buffer_loclist_map = {'1': [{'lnum': 1, 'bufnr': 1, 'vcol': 0, 'linter_name': 'testlinter', 'nr': -1, 'type': 'E', 'col': 1, 'text': 'Test Error'}]}
@@ -29,10 +29,10 @@ After:
let g:ale_buffer_loclist_map = {}
Execute (Count should be match the loclist):
- AssertEqual ale#statusline#Count(1), [1, 0]
+ AssertEqual [1, 0], ale#statusline#Count(1)
Execute (Output should be empty for non-existant buffer):
- AssertEqual ale#statusline#Count(9001), [0, 0]
+ AssertEqual [0, 0], ale#statusline#Count(9001)
Before:
let g:ale_statusline_format = ['%sE', '%sW', 'OKIE']
@@ -44,22 +44,22 @@ Execute (Given some errors):
call ale#statusline#Update(bufnr('%'), [{'type': 'E'}, {'type': 'E'}])
Then (Statusline is formatted to the users preference):
- AssertEqual ale#statusline#Status(), "2E"
+ AssertEqual '2E', ale#statusline#Status()
Execute (Given some warnings):
call ale#statusline#Update(bufnr('%'), [{'type': 'W'}, {'type': 'W'}, {'type': 'W'}])
Then (Statusline is formatted to the users preference):
- AssertEqual ale#statusline#Status(), "3W"
+ AssertEqual '3W', ale#statusline#Status()
Execute (Given some warnings, and errors.):
call ale#statusline#Update(bufnr('%'), [{'type': 'E'}, {'type': 'W'}, {'type': 'W'}])
Then (Statusline is formatted to the users preference):
- AssertEqual ale#statusline#Status(), "1E 2W"
+ AssertEqual '1E 2W', ale#statusline#Status()
Execute (Given a lack of data):
call ale#statusline#Update(bufnr('%'), [])
Then (Statusline is formatted to the users preference):
- AssertEqual ale#statusline#Status(), 'OKIE'
+ AssertEqual 'OKIE', ale#statusline#Status()
diff --git a/test/test_common_handlers.vader b/test/test_common_handlers.vader
index d9fb0060..678b9337 100644
--- a/test/test_common_handlers.vader
+++ b/test/test_common_handlers.vader
@@ -5,7 +5,7 @@ Execute (Run HandleCSSLintFormat):
\])
Then (The loclist should be correct):
- AssertEqual g:loclist, [
+ AssertEqual [
\ {
\ 'bufnr': 42,
\ 'vcol': 0,
@@ -24,7 +24,7 @@ Then (The loclist should be correct):
\ 'type': 'W',
\ 'text': "(known-properties) Expected ... but found 'wat'.",
\ },
- \]
+ \], g:loclist
Execute (Run HandleGCCFormat):
let g:loclist = ale#handlers#HandleGCCFormat(42, [
@@ -33,7 +33,7 @@ Execute (Run HandleGCCFormat):
\])
Then (The loclist should be correct):
- AssertEqual g:loclist, [
+ AssertEqual [
\ {
\ 'bufnr': 42,
\ 'vcol': 0,
@@ -52,7 +52,7 @@ Then (The loclist should be correct):
\ 'type': 'E',
\ 'text': 'invalid operands to binary - (have ‘int’ and ‘char *’)',
\ },
- \]
+ \], g:loclist
Execute (Run HandleUnixFormatAsError):
let g:loclist = ale#handlers#HandleUnixFormatAsError(42, [
@@ -61,7 +61,7 @@ Execute (Run HandleUnixFormatAsError):
\])
Then (The loclist should be correct):
- AssertEqual g:loclist, [
+ AssertEqual [
\ {
\ 'bufnr': 42,
\ 'vcol': 0,
@@ -80,7 +80,7 @@ Then (The loclist should be correct):
\ 'type': 'E',
\ 'text': 'if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)',
\ },
- \]
+ \], g:loclist
Execute (Run HandleUnixFormatAsWarning):
let g:loclist = ale#handlers#HandleUnixFormatAsWarning(42, [
@@ -89,7 +89,7 @@ Execute (Run HandleUnixFormatAsWarning):
\])
Then (The loclist should be correct):
- AssertEqual g:loclist, [
+ AssertEqual [
\ {
\ 'bufnr': 42,
\ 'vcol': 0,
@@ -108,7 +108,7 @@ Then (The loclist should be correct):
\ 'type': 'W',
\ 'text': 'if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)',
\ },
- \]
+ \], g:loclist
Execute (Run a Unix format function with a Windows path):
let g:loclist = ale#handlers#HandleUnixFormatAsError(42, [
@@ -117,7 +117,7 @@ Execute (Run a Unix format function with a Windows path):
\])
Then (The loclist should be correct):
- AssertEqual g:loclist, [
+ AssertEqual [
\ {
\ 'bufnr': 42,
\ 'vcol': 0,
@@ -136,7 +136,7 @@ Then (The loclist should be correct):
\ 'type': 'E',
\ 'text': 'foo',
\ },
- \]
+ \], g:loclist
After:
unlet g:loclist
diff --git a/test/test_loclist_binary_search.vader b/test/test_loclist_binary_search.vader
index 97d8a026..e0b2c651 100644
--- a/test/test_loclist_binary_search.vader
+++ b/test/test_loclist_binary_search.vader
@@ -10,17 +10,17 @@ Before:
\]
Execute (Exact column matches should be correct):
- AssertEqual ale#util#BinarySearch(g:loclist, 3, 2), 1
+ AssertEqual 1, ale#util#BinarySearch(g:loclist, 3, 2)
Execute (Off lines, there should be no match):
- AssertEqual ale#util#BinarySearch(g:loclist, 4, 2), -1
+ AssertEqual -1, ale#util#BinarySearch(g:loclist, 4, 2)
Execute (Near column matches should be taken):
- AssertEqual ale#util#BinarySearch(g:loclist, 3, 11), 2
- AssertEqual ale#util#BinarySearch(g:loclist, 3, 13), 4
+ AssertEqual 2, ale#util#BinarySearch(g:loclist, 3, 11)
+ AssertEqual 4, ale#util#BinarySearch(g:loclist, 3, 13)
Execute (Columns before should be taken when the cursor is far ahead):
- AssertEqual ale#util#BinarySearch(g:loclist, 3, 300), 4
+ AssertEqual 4, ale#util#BinarySearch(g:loclist, 3, 300)
After:
unlet g:loclist
diff --git a/test/test_loclist_sorting.vader b/test/test_loclist_sorting.vader
index fe4bc688..6e52be6f 100644
--- a/test/test_loclist_sorting.vader
+++ b/test/test_loclist_sorting.vader
@@ -10,12 +10,12 @@ Execute (Sort loclist with comparison function):
call sort(g:loclist, 'ale#util#LocItemCompare')
Then (loclist item should be sorted):
- AssertEqual g:loclist, [
+ AssertEqual [
\ {'lnum': 2, 'col': 10},
\ {'lnum': 3, 'col': 2},
\ {'lnum': 5, 'col': 4},
\ {'lnum': 5, 'col': 5},
- \]
+ \], g:loclist
After:
unlet g:loclist