aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/buffer_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/api/buffer_spec.lua')
-rw-r--r--test/functional/api/buffer_spec.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/api/buffer_spec.lua b/test/functional/api/buffer_spec.lua
index aea1f359e6..292e5a2d56 100644
--- a/test/functional/api/buffer_spec.lua
+++ b/test/functional/api/buffer_spec.lua
@@ -1151,6 +1151,18 @@ describe('api/buf', function()
eq(6, bufmeths.get_offset(1,1))
command("bunload! 1")
eq(-1, bufmeths.get_offset(1,1))
+ eq(-1, bufmeths.get_offset(1,0))
+ end)
+
+ it('works in empty buffer', function()
+ eq(0, get_offset(0))
+ eq(1, get_offset(1))
+ end)
+
+ it('works in buffer with one line inserted', function()
+ feed('itext')
+ eq(0, get_offset(0))
+ eq(5, get_offset(1))
end)
end)