aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/wordcount_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-04-26 11:35:05 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-04-26 11:38:58 +0800
commit519e4c44720be9b0c8584cb53a902bc1e5bfe3a3 (patch)
treec22f82a0c739a99729d3d07a2af228b31dacaf4e /test/functional/legacy/wordcount_spec.lua
parent5d159a7faad913852c65c81dcc976cf4be902fc1 (diff)
downloadrneovim-519e4c44720be9b0c8584cb53a902bc1e5bfe3a3.tar.gz
rneovim-519e4c44720be9b0c8584cb53a902bc1e5bfe3a3.tar.bz2
rneovim-519e4c44720be9b0c8584cb53a902bc1e5bfe3a3.zip
test: correct order of arguments to eq() and neq()
Diffstat (limited to 'test/functional/legacy/wordcount_spec.lua')
-rw-r--r--test/functional/legacy/wordcount_spec.lua66
1 files changed, 33 insertions, 33 deletions
diff --git a/test/functional/legacy/wordcount_spec.lua b/test/functional/legacy/wordcount_spec.lua
index 826743b0ca..21f96628c0 100644
--- a/test/functional/legacy/wordcount_spec.lua
+++ b/test/functional/legacy/wordcount_spec.lua
@@ -50,44 +50,44 @@ describe('wordcount', function()
]=])
-- Test 1: empty window
- eq(eval('DoRecordWin()'),
- eval([=[
+ eq(eval([=[
[[''], {'chars': 0, 'cursor_chars': 0, 'words': 0, 'cursor_words': 0, 'bytes': 0, 'cursor_bytes': 0}]
- ]=])
+ ]=]),
+ eval('DoRecordWin()')
)
-- Test 2: some words, cursor at start
command([[call PutInWindow('one two three')]])
- eq(eval('DoRecordWin([1, 1, 0])'),
- eval([=[
+ eq(eval([=[
[['', 'one two three'], {'chars': 15, 'cursor_chars': 1, 'words': 3, 'cursor_words': 0, 'bytes': 15, 'cursor_bytes': 1}]
- ]=])
+ ]=]),
+ eval('DoRecordWin([1, 1, 0])')
)
-- Test 3: some words, cursor at end
command([[call PutInWindow('one two three')]])
- eq(eval('DoRecordWin([2, 99, 0])'),
- eval([=[
+ eq(eval([=[
[['', 'one two three'], {'chars': 15, 'cursor_chars': 14, 'words': 3, 'cursor_words': 3, 'bytes': 15, 'cursor_bytes': 14}]
- ]=])
+ ]=]),
+ eval('DoRecordWin([2, 99, 0])')
)
-- Test 4: some words, cursor at end, ve=all
command('set ve=all')
command([[call PutInWindow('one two three')]])
- eq(eval('DoRecordWin([2,99,0])'),
- eval([=[
+ eq(eval([=[
[['', 'one two three'], {'chars': 15, 'cursor_chars': 15, 'words': 3, 'cursor_words': 3, 'bytes': 15, 'cursor_bytes': 15}]
- ]=])
+ ]=]),
+ eval('DoRecordWin([2,99,0])')
)
command('set ve=')
-- Test 5: several lines with words
command([=[call PutInWindow(['one two three', 'one two three', 'one two three'])]=])
- eq(eval('DoRecordWin([4,99,0])'),
- eval([=[
+ eq(eval([=[
[['', 'one two three', 'one two three', 'one two three'], {'chars': 43, 'cursor_chars': 42, 'words': 9, 'cursor_words': 9, 'bytes': 43, 'cursor_bytes': 42}]
- ]=])
+ ]=]),
+ eval('DoRecordWin([4,99,0])')
)
-- Test 6: one line with BOM set
@@ -95,10 +95,10 @@ describe('wordcount', function()
command('wincmd k')
command('set bomb')
command('wincmd j')
- eq(eval('DoRecordWin([2,99,0])'),
- eval([=[
+ eq(eval([=[
[['', 'one two three'], {'chars': 15, 'cursor_chars': 14, 'words': 3, 'cursor_words': 3, 'bytes': 18, 'cursor_bytes': 14}]
- ]=])
+ ]=]),
+ eval('DoRecordWin([2,99,0])')
)
command('wincmd k')
command('set nobomb')
@@ -106,18 +106,18 @@ describe('wordcount', function()
-- Test 7: one line with multibyte words
command([=[call PutInWindow(['Äne M¤ne Müh'])]=])
- eq(eval('DoRecordWin([2,99,0])'),
- eval([=[
+ eq(eval([=[
[['', 'Äne M¤ne Müh'], {'chars': 14, 'cursor_chars': 13, 'words': 3, 'cursor_words': 3, 'bytes': 17, 'cursor_bytes': 16}]
- ]=])
+ ]=]),
+ eval('DoRecordWin([2,99,0])')
)
-- Test 8: several lines with multibyte words
command([=[call PutInWindow(['Äne M¤ne Müh', 'und raus bist dü!'])]=])
- eq(eval('DoRecordWin([3,99,0])'),
- eval([=[
+ eq(eval([=[
[['', 'Äne M¤ne Müh', 'und raus bist dü!'], {'chars': 32, 'cursor_chars': 31, 'words': 7, 'cursor_words': 7, 'bytes': 36, 'cursor_bytes': 35}]
- ]=])
+ ]=]),
+ eval('DoRecordWin([3,99,0])')
)
-- Test 9: visual mode, complete buffer
@@ -131,10 +131,10 @@ describe('wordcount', function()
command('set stl= ls=1')
command('let log=DoRecordWin([3,99,0])')
command('let log[1]=g:visual_stat')
- eq(eval('log'),
- eval([=[
+ eq(eval([=[
[['', 'Äne M¤ne Müh', 'und raus bist dü!'], {'chars': 32, 'words': 7, 'bytes': 36, 'visual_chars': 32, 'visual_words': 7, 'visual_bytes': 36}]
- ]=])
+ ]=]),
+ eval('log')
)
-- Test 10: visual mode (empty)
@@ -148,10 +148,10 @@ describe('wordcount', function()
command('set stl= ls=1')
command('let log=DoRecordWin([3,99,0])')
command('let log[1]=g:visual_stat')
- eq(eval('log'),
- eval([=[
+ eq(eval([=[
[['', 'Äne M¤ne Müh', 'und raus bist dü!'], {'chars': 32, 'words': 7, 'bytes': 36, 'visual_chars': 1, 'visual_words': 0, 'visual_bytes': 1}]
- ]=])
+ ]=]),
+ eval('log')
)
-- Test 11: visual mode, single line
@@ -165,10 +165,10 @@ describe('wordcount', function()
command('set stl= ls=1')
command('let log=DoRecordWin([3,99,0])')
command('let log[1]=g:visual_stat')
- eq(eval('log'),
- eval([=[
+ eq(eval([=[
[['', 'Äne M¤ne Müh', 'und raus bist dü!'], {'chars': 32, 'words': 7, 'bytes': 36, 'visual_chars': 13, 'visual_words': 3, 'visual_bytes': 16}]
- ]=])
+ ]=]),
+ eval('log')
)
end)
end)