diff options
Diffstat (limited to 'test/functional/api/extmark_spec.lua')
-rw-r--r-- | test/functional/api/extmark_spec.lua | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/test/functional/api/extmark_spec.lua b/test/functional/api/extmark_spec.lua index 5bf3fa554f..9ea35e50a2 100644 --- a/test/functional/api/extmark_spec.lua +++ b/test/functional/api/extmark_spec.lua @@ -204,13 +204,13 @@ describe('API/extmarks', function() eq({marks[2], positions[2][1], positions[2][2]}, rv[2]) -- nextrange with `limit` rv = get_extmarks(ns, marks[1], marks[3], {limit=2}) - eq(2, table.getn(rv)) + eq(2, #rv) -- nextrange with positional when mark exists at position rv = get_extmarks(ns, positions[1], positions[3]) eq({marks[1], positions[1][1], positions[1][2]}, rv[1]) eq({marks[2], positions[2][1], positions[2][2]}, rv[2]) rv = get_extmarks(ns, positions[2], positions[3]) - eq(2, table.getn(rv)) + eq(2, #rv) -- nextrange with positional index (no mark at position) local lower = {positions[1][1], positions[2][2] -1} local upper = {positions[2][1], positions[3][2] - 1} @@ -248,14 +248,14 @@ describe('API/extmarks', function() eq({marks[1], positions[1][1], positions[1][2]}, rv[3]) -- prevrange with limit rv = get_extmarks(ns, marks[3], marks[1], {limit=2}) - eq(2, table.getn(rv)) + eq(2, #rv) -- prevrange with positional when mark exists at position rv = get_extmarks(ns, positions[3], positions[1]) eq({{marks[3], positions[3][1], positions[3][2]}, {marks[2], positions[2][1], positions[2][2]}, {marks[1], positions[1][1], positions[1][2]}}, rv) rv = get_extmarks(ns, positions[2], positions[1]) - eq(2, table.getn(rv)) + eq(2, #rv) -- prevrange with positional index (no mark at position) lower = {positions[2][1], positions[2][2] + 1} upper = {positions[3][1], positions[3][2] + 1} @@ -282,19 +282,19 @@ describe('API/extmarks', function() end local rv = get_extmarks(ns, {0, 0}, {-1, -1}, {limit=1}) - eq(1, table.getn(rv)) + eq(1, #rv) rv = get_extmarks(ns, {0, 0}, {-1, -1}, {limit=2}) - eq(2, table.getn(rv)) + eq(2, #rv) rv = get_extmarks(ns, {0, 0}, {-1, -1}, {limit=3}) - eq(3, table.getn(rv)) + eq(3, #rv) -- now in reverse rv = get_extmarks(ns, {0, 0}, {-1, -1}, {limit=1}) - eq(1, table.getn(rv)) + eq(1, #rv) rv = get_extmarks(ns, {0, 0}, {-1, -1}, {limit=2}) - eq(2, table.getn(rv)) + eq(2, #rv) rv = get_extmarks(ns, {0, 0}, {-1, -1}, {limit=3}) - eq(3, table.getn(rv)) + eq(3, #rv) end) it('get_marks works when mark col > upper col', function() @@ -798,17 +798,17 @@ describe('API/extmarks', function() feed("u") local rv = get_extmarks(ns, {0, 0}, {-1, -1}) - eq(3, table.getn(rv)) + eq(3, #rv) feed("<c-r>") rv = get_extmarks(ns, {0, 0}, {-1, -1}) - eq(3, table.getn(rv)) + eq(3, #rv) -- Test updates feed('o<esc>') set_extmark(ns, marks[1], positions[1][1], positions[1][2]) rv = get_extmarks(ns, marks[1], marks[1], {limit=1}) - eq(1, table.getn(rv)) + eq(1, #rv) feed("u") feed("<c-r>") -- old value is NOT kept in history @@ -820,10 +820,10 @@ describe('API/extmarks', function() feed("u") rv = get_extmarks(ns, {0, 0}, {-1, -1}) -- undo does NOT restore deleted marks - eq(2, table.getn(rv)) + eq(2, #rv) feed("<c-r>") rv = get_extmarks(ns, {0, 0}, {-1, -1}) - eq(2, table.getn(rv)) + eq(2, #rv) end) it('undo and redo of marks deleted during edits', function() @@ -840,9 +840,9 @@ describe('API/extmarks', function() rv = set_extmark(ns2, marks[1], positions[1][1], positions[1][2]) eq(1, rv) rv = get_extmarks(ns, {0, 0}, {-1, -1}) - eq(1, table.getn(rv)) + eq(1, #rv) rv = get_extmarks(ns2, {0, 0}, {-1, -1}) - eq(1, table.getn(rv)) + eq(1, #rv) -- Set more marks for testing the ranges set_extmark(ns, marks[2], positions[2][1], positions[2][2]) @@ -852,32 +852,32 @@ describe('API/extmarks', function() -- get_next (limit set) rv = get_extmarks(ns, {0, 0}, positions[2], {limit=1}) - eq(1, table.getn(rv)) + eq(1, #rv) rv = get_extmarks(ns2, {0, 0}, positions[2], {limit=1}) - eq(1, table.getn(rv)) + eq(1, #rv) -- get_prev (limit set) rv = get_extmarks(ns, positions[1], {0, 0}, {limit=1}) - eq(1, table.getn(rv)) + eq(1, #rv) rv = get_extmarks(ns2, positions[1], {0, 0}, {limit=1}) - eq(1, table.getn(rv)) + eq(1, #rv) -- get_next (no limit) rv = get_extmarks(ns, positions[1], positions[2]) - eq(2, table.getn(rv)) + eq(2, #rv) rv = get_extmarks(ns2, positions[1], positions[2]) - eq(2, table.getn(rv)) + eq(2, #rv) -- get_prev (no limit) rv = get_extmarks(ns, positions[2], positions[1]) - eq(2, table.getn(rv)) + eq(2, #rv) rv = get_extmarks(ns2, positions[2], positions[1]) - eq(2, table.getn(rv)) + eq(2, #rv) curbufmeths.del_extmark(ns, marks[1]) rv = get_extmarks(ns, {0, 0}, {-1, -1}) - eq(2, table.getn(rv)) + eq(2, #rv) curbufmeths.del_extmark(ns2, marks[1]) rv = get_extmarks(ns2, {0, 0}, {-1, -1}) - eq(2, table.getn(rv)) + eq(2, #rv) end) it('mark set can create unique identifiers', function() |