From 57ac9b093465077f691359909c795c0259dec7ba Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Tue, 16 Aug 2016 21:55:37 +0200 Subject: api: handle null string in buffer_add_highlight --- test/functional/ui/bufhl_spec.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test/functional') diff --git a/test/functional/ui/bufhl_spec.lua b/test/functional/ui/bufhl_spec.lua index a8006e1ac6..80d413a455 100644 --- a/test/functional/ui/bufhl_spec.lua +++ b/test/functional/ui/bufhl_spec.lua @@ -111,12 +111,16 @@ describe('Buffer highlighting', function() add_hl(id1, "ImportantWord", 2, 0, 9) add_hl(id1, "ImportantWord", 3, 5, 14) - id2 = add_hl(0, "Special", 0, 2, 8) + -- add_highlight can be called like this to get a new source + -- without adding any highlight + id2 = add_hl(0, "", 0, 0, 0) + neq(id1, id2) + + add_hl(id2, "Special", 0, 2, 8) add_hl(id2, "Identifier", 1, 3, 8) add_hl(id2, "Special", 1, 14, 20) add_hl(id2, "Underlined", 2, 6, 12) add_hl(id2, "Underlined", 3, 0, 9) - neq(id1, id2) screen:expect([[ a {5:longer} example | -- cgit