From 30a5c28c8740d2e07c20cb58822b7d7aa489b728 Mon Sep 17 00:00:00 2001 From: Thomas Vigouroux Date: Wed, 19 Jul 2023 17:56:25 +0200 Subject: feat(decoration_provider): log errors as error messages --- test/functional/ui/decorations_spec.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test/functional/ui') diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua index cee1e32114..ef55784ca8 100644 --- a/test/functional/ui/decorations_spec.lua +++ b/test/functional/ui/decorations_spec.lua @@ -37,6 +37,7 @@ describe('decorations providers', function() [15] = {special = Screen.colors.Blue, undercurl = true}, [16] = {special = Screen.colors.Red, undercurl = true}, [17] = {foreground = Screen.colors.Red}, + [18] = {bold = true, foreground = Screen.colors.SeaGreen}; } end) @@ -611,6 +612,27 @@ describe('decorations providers', function() assert(eok == false) ]]) end) + + it('errors gracefully', function() + insert(mulholland) + + setup_provider [[ + function on_do(...) + error "Foo" + end + ]] + + screen:expect{grid=[[ + {2:Error in decoration provider ns1.start:} | + {2:Error executing lua: [string ""]:4}| + {2:: Foo} | + {2:stack traceback:} | + {2: [C]: in function 'error'} | + {2: [string ""]:4: in function}| + {2: <[string ""]:3>} | + {18:Press ENTER or type command to continue}^ | + ]]} + end) end) local example_text = [[ -- cgit